Ethsim2 requests maintainer feedback on an automated security review finding regarding a pull request for backup download resume functionality. The concern is that a previously authorized resume token could be exploited if an administrator deletes a backup and uploads a new file with the exact same filename within the resume window, potentially allowing the new file to be served to a session with an old token.
The author notes that standard auto-generated Discourse backup filenames include timestamps down to the second, making accidental reuse unlikely. They also emphasize that exploiting this vulnerability requires an authenticated admin session, a still-valid resume grant, and deliberate file replacement. Furthermore, the feature is disabled by default, and the resume window is time-limited. Ethsim2 acknowledges that manual uploads can reuse filenames, meaning the filename alone doesn’t guarantee immutable file identity, but questions whether file-identity verification is necessary given the low risk profile.
Ethsim2 seeks a balance between security, implementation complexity, and the utility of resuming large interrupted downloads, asking if the residual risk is acceptable to document rather than mitigate.
Ed_S replies, suggesting the risk is minimal. He argues that it is unclear how a different file with the same name could appear unless the system was already compromised. Additionally, since the access token has a short lifetime, the attack window is extremely small.
I’ve received an automated security review finding on the proposed backup download resume PR:
The finding concerns the possibility of a previously authorised resume token being used after a backup has been deleted and another file uploaded under the same filename.
My understanding is that Discourse’s automatically generated backup filenames include a timestamp down to the second, making accidental reuse unlikely during normal backup creation.
The reported scenario also appears to require an authenticated administrator’s session, a still-valid resume grant and replacement of a backup under the same filename.
I recognise that manually uploaded backup files can reuse an existing filename, and therefore that the filename alone does not provide an immutable file identity.
However, I would appreciate the maintainers’ views on whether this represents a sufficiently realistic risk to require additional file-identity verification, particularly given that resumable downloads are disabled by default and the enabled resume window is time-limited.
Would it be reasonable to accept and document this residual risk, or would maintainers consider file-identity verification necessary before the feature could be merged?
I’d be interested in finding an appropriate balance between security, implementation complexity and the original aim of allowing interrupted large backup downloads to resume.
(I’m not a maintainer but this risk seems minimal to me. It’s not even clear how a different file with the same name could appear unless the system was already compromised. And if the access token has a reasonably short lifetime, as you say, the window is minimal.)