Repository navigation
fix(forge): close six low-severity audit findings and read admin passwords from stdin - #363
Merged
Merged
Conversation
…an unparsable one
…m raw forwarded-for fields
…ount header in the departures
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tonibergholm
approved these changes
Nov 20, 2026
tonibergholm
left a comment
Member
There was a problem hiding this comment.
Reviewed: sol-loop (2 rounds; one race item declined with reason in the description), required checks and conformance green, CodeQL clean, Codex review has no findings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A security audit of sc-forge found no critical or high issue. It did find six low-severity ones, which this PR fixes:
PATCH default_branchand run-time lock cleanup. Now onlyreceive-packregisters as a writer.Retry-After, and refunds exactly that attempt's reservation, so the rate limit stays correct.GET /orgs/{o},GET /orgs/{o}/reposandGET /users/{u}/orgs/{o}/permissionsanswered differently for a private org than for a missing one. A non-member now gets the missing-org answer. A collaborator of a repository inside the org still sees that repository. Gitea 1.22 records the leaking answers, so this adds three departures. The conformance checker gained two keys to pin them:body(exact JSON, compared recursively) andabsent_headers.ip:port, non-UTF-8 values or repeated header fields, were skipped. Behind such a proxy the walk could land on a client-chosen entry. The header is now read once, in order, from all raw values.ip:portand[v6]:portparse, an unparseable entry stops the walk, and dispatch and the access log use the same result.sc-forge admin user createandchange-passwordtake--password-stdin.--passwordstill works.SC_FORGE_MERGE_PAUSE_MSis now read only in debug builds, like the other test knobs.Unchanged by decision, recorded in the threat model: listing and creating repositories need no repository scope (Gitea's requirement is unrecorded, #316), and tokens never expire and survive a password change (Gitea 1.22 parity).
Proof: each fix has a test that fails without it:
only_receive_pack_registers_as_a_writera_busy_password_gate_answers_503_and_refunds_the_attempt(at source cap 1)a_refund_gives_back_exactly_its_own_reservationprivate_org_permissions_are_hidden_from_outsiders(byte-identical answers)forwarded_for_ports_are_parsed_and_junk_stops_the_walkrepeated_and_non_utf8_forwarded_for_fields_are_one_ordered_chainadmin_passwords_can_come_from_stdin_but_not_both_wayscargo test -p scl-forgepasses, andforge-check.shpasses 24/24 with selftest ok.Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: changes requested on one item, declined. If a caller's last readable repository in a private org is revoked between the count and the page query, the caller can still get
200 []. That only tells them the org exists, which they knew while they had access.Closes #337.
Created with Claude Opus 5.5 and Claude Sonnet 5.5 in Claude Code.