Repository navigation
Security hardening: safe previews, smb.conf injection, headers - #34
Merged
Merged
Conversation
- inline preview only serves inert types (images, video, audio, PDF, plain text); HTML/SVG and everything else is forced to download, with nosniff and a sandbox CSP, so a file on a share cannot run script in the dashboard - security headers on every response (CSP, X-Frame-Options, nosniff, Referrer-Policy, no-store on the API) - refuse to share a folder whose path has control characters or '%', and reject control characters in new file names: a newline could inject a directive into the generated smb.conf - usernames must start with a letter or underscore so they can never be read as an option by useradd/smbpasswd; passwords reject newlines - deleting a symlink removes the link instead of emptying its target - drop unused passlib dependency - CI: pin actions by SHA, read-only token; stop the bimonthly update from committing its own report files
uvicorn ran with --forwarded-allow-ips=*, which let any client forge its source address and bypass the failed-login throttle. Default is now 127.0.0.1; FORWARDED_ALLOW_IPS is documented for reverse-proxy setups.
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 found in a security review:
/api/files/download?inline=trueserved any file with its guessed type from the dashboard's origin, so an HTML or SVG file dropped on a share ran script with the admin session. Only inert types are shown inline now; the rest download, withnosniffand a sandbox CSP.path =. Such paths are refused and new names can't contain control characters.-xwere passed touseradd/smbpasswd. Usernames must now start with a letter or_.passlibremoved, actions pinned by SHA, and the bimonthly update no longer commits its report files.82 backend tests pass, including new regression tests.