fileName now take the upload code
This commit is contained in:
@@ -270,10 +270,12 @@ paths or stack traces.
|
||||
(salted), never in plaintext. Successful entry mints a short-lived HMAC-signed
|
||||
cookie, so access is granted by the server and cannot be forged.
|
||||
- **Path safety.** Filesystem paths are built only from server-generated,
|
||||
regex-validated ids (`^[a-z0-9]{12}$`). The original filename is metadata
|
||||
regex-validated ids (`^[a-z0-9]{8}$`). The original filename is metadata
|
||||
only and is sanitized (basename, control/null bytes stripped) before being
|
||||
stored or emitted in `Content-Disposition`. Path traversal, `../`, encoded
|
||||
traversal, null bytes, and symlink injection via user input are not possible.
|
||||
stored; downloads are sent as `<upload-key>.<extension>`, so the basename in
|
||||
`Content-Disposition` is always the server-generated key. Path traversal,
|
||||
`../`, encoded traversal, null bytes, and symlink injection via user input are
|
||||
not possible.
|
||||
Downloads additionally refuse symlinks (`lstat`) as defense in depth.
|
||||
- **MIME / XSS.** Downloads are sent as `Content-Disposition: attachment` (browsers
|
||||
download rather than render) with `X-Content-Type-Options: nosniff`, so a spoofed
|
||||
|
||||
Reference in New Issue
Block a user