security: fixes from the upstream hardening review, release 6.9.4 #26
No reviewers
Labels
No labels
upstream-feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
tim/omnimem!26
Loading…
Reference in a new issue
No description provided.
Delete branch "security/hardening-review-24"
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?
Closes #24.
Reviewed the areas upstream 7.0.3 says it hardened (OAuth, RSS fetching, skill bundles) against the Python code. Upstream's Rust diff is not portable, so the review used its release-note checklist: private/loopback blocking and redirect re-checks for RSS, declared-size checks for bundles, size caps / rate limits / strict PKCE and redirect URIs / hashed tokens for OAuth.
Fixed (each test fails on the old code)
rss_worker/safe_fetch.pychecks the address at connect time (covers every redirect hop and DNS answers), http(s) only, max 5 redirects. feedparser now gets bytes, sofile:URLs and local paths infeeds.ymlare no longer readable.RSS_ALLOW_PRIVATE_HOSTS=trueopts out;RSS_MAX_FEED_BYTEScaps feeds.ZipFile.read()inflates the whole stream whatever the header declares. A 200 KB bundle declaring 10 bytes allocated 458 MB before the CRC check failed. Entries are now read throughopen()with a 1 MB cap; the web upload reads at most 20 MB + 1.redirect_uriwas never validated, and the login handler redirects to it. Now https, loopback http and custom app schemes only; nojavascript:/data:/file:etc., fragments or credentials; URI count, length and client name capped./authorizegrew an in-memory table without bound. Pruned per call, capped at 1000.Reviewed, left alone (in CHANGELOG)
oauth:*is not in backups; hashing would sign out every client, so not done./registerhas no rate limit and clients have no TTL. Entries are now bounded, flood is still possible slowly. Not fixed here.Behaviour changes to know about
RSS_ALLOW_PRIVATE_HOSTS=true.http_proxy.http://redirect URIs on a non-loopback host are refused.Checks
ruff check,ruff format --check, ASCII check,bandit -ll(no findings, no suppressions added).pytest: 2071 passed, 1 skipped (baseline 2008). New:test_safe_fetch.py(real sockets, incl. redirect to loopback),test_skill_transfer_zipbomb.py,test_oauth_hardening.py, upload bound intest_web_skill_transfer.py.🤖 Generated with Claude Code