mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2333] [Issue]: /health is unauthenticated, un-rate-limited, and does a disk write+delete on every request (server runtime) #1160
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1160
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2333
Originally assigned to: @Xelvanis on GitHub.
Summary
Severity: Low — Performance / DoS-hardening (server runtime). On the Axum server runtime,
/healthbypasses both auth and rate limiting, and performs a real disk write + delete on every request. An unauthenticated remote client can flood/healthto drive sustained disk write/unlink churn and inode/dentry pressure on the data volume with zero throttling.Expected behavior
/healthshould return a cheap liveness response without touching disk on every request. The writable probe should be gated (e.g. behind a?probe=1flag) and/or its result cached for a few seconds.Actual behavior
src-tauri/src/http_server.rs:174-198:probe_data_dir_writable(187-198) doescreate_dir_all+write(path, b"ok")+remove_file(path)on every hit, with a uniquely-named temp file (no caching). Auth is bypassed:evaluate_request(1660-1665) returnsOk(())early forpath == "/health". Rate-limit is bypassed:ApiRateLimiter::check(1398-1405) returnsNonefor non-/api/paths (a test at 2454 asserts the exemption). So an unauthenticated, un-throttled GET flood drives 2 filesystem mutations per request on the data volume.Steps to reproduce
GET /health.Impact area
Environment
b0e5561dLogs, screenshots, or video
Static source audit; cited to file:line above.
Regression notes
Found via static audit of the refactor branch; not verified against main. The write is 2 bytes + immediate unlink (modest amplification), and unauthenticated/rate-exempt
/healthis a legitimate liveness-probe design; the fixable part is doing real disk I/O per probe, hence low.Additional context
Suggested fix: default
/healthreturns a cheap liveness response without touching disk; gate the writable probe behind an explicit flag (e.g.?probe=1) and/or cache the writable result for a few seconds so repeated hits don't re-probe per request.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: