Details
Observed output from this environment after re-running the proof after drafting:
May 29, 06:13PM: Upload of total size 274.0 B is starting
=> 27.0 B audit.txt positive_status: 200
positive_response: {"info_flashes": ["Nothing submitted or message was too long (> 524288 characters)"]}
positive_written: [('2026-05-29/181347904165/audit.txt', 'DISABLE_FILES_BYPASS_MARKER')]
The response says nothing/fileless was submitted, but the audit.txt file was created under the Receive data directory.
Negative/control case:
web2.settings.set('receive', 'disable_text', True)
# POST only a text field to /upload-ajax
Observed control output:
control_status: 200
control_response: {"info_flashes": ["Nothing submitted"]}
control_written_files: []
cleanup_done: true
Cleanup:
- The PoC deletes all temporary directories with
shutil.rmtree(...); the audit run printedcleanup_done: true.
Impact
A Receive service operator can configure OnionShare as a text-only submission endpoint (for example, an anonymous contact form) and still receive attacker-controlled files on disk. This bypasses the explicit user-selected restriction and can lead to unwanted file placement and disk consumption in a deployment where file uploads were intentionally disabled.
The response and GUI/history accounting can be misleading because the route skips file processing while the lower-level request stream has already written the file. This may delay detection by the operator.
The confirmed issue does not provide arbitrary path traversal because filenames are sanitized and writes occur under the configured Receive data directory.
Suggested remediation
Enforce disable_files before any multipart file stream is written, not only in the route handler or template:
- In
ReceiveModeRequest._get_file_stream(), ifself.web.settings.get("receive", "disable_files")is true, reject the file part before creatingReceiveModeFile, or route it to a discard stream and mark the request as rejected. - Ensure
/uploadand/upload-ajaxreturn an explicit error when files are submitted while files are disabled. - Avoid creating a receive subdirectory for a file-only request that is rejected by policy.
- Add regression tests for both
/uploadand/upload-ajaxproving no file appears underreceive.data_dirwhenreceive.disable_filesis true. - Add a control regression test proving
disable_textstill prevents message-file creation.