Repository navigation
Fix the high and medium findings of the security review - #28
Merged
Merged
Conversation
- Count wrong two-factor codes per account, wherever they come from: after 5 in a row, each next code waits a minute, then twice as long after each wrong one, up to a day. The client's budget alone let someone with the password guess codes from many addresses. - Ask for the password to make an app password, or to set up two-factor sign-in, so that a stolen session cannot become a lasting WebDAV login or lock its user out. App passwords and passkeys made while the password changes are refused, as sessions already were. - Give an upload link's use back only for an upload really forgotten, and forget a stored upload before removing its temp file: a HEAD at that moment gave the use and its bytes back. - Count folders against home quotas (4 KiB each), and check the free space, and the last 1% of the disk's inodes, before folders and empty files are made, which no write checked before. - Have links follow what they lead to when it is renamed or moved, and end when it is deleted, so that none leads to what is made in its place. - Keep the last 50 MB of each container's log. - Also: re-check an entry after locking it for deletion, keep tokens out of the log line of unknown methods, and copy the passkey host name out of the request buffer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the high and medium findings of the security review, and a few cheap low ones in the same code.
High
429withRetry-After, and are logged aslogin codes refused. Input too short or long to be a code doesn't count.Medium
password.upload.min_freeand the last 1% of the disk's inodes.Low, in the same code
Not in this PR
:latestbefore tests and govulncheck pass;upload.min_free;Rollout
/opt/goftp/docker-compose.ymlis root-owned, so the deploy won't update it. Install it again as the README describes. The nextcompose upthen recreates both containers, which restarts Postgres for a moment./.sync/action=create) or start two-factor setup (action=start) must sendpassword.Tests
TestWrongCodes, andTestTwoFactorCodeLimitover HTTP;TestResumableLinkUseKept(it fails against the old store behavior);TestMinFree;TestHomeQuotaFolders;TestLinkFollowsItsEntry.go test ./...passes on Linux (golang:1.27.3-alpine) against Postgres 18.-racepasses on macOS, apart from the known macOS-onlyTestLongNonASCIIPath.🤖 Generated with Claude Code