Repository navigation
security(config): don't send API key to base_url from project .cora.yaml - #563
Merged
Merged
Conversation
- ignore provider.base_url from a discovered .cora.yaml unless CORA_TRUST_PROJECT_CONFIG=1 - require https base_url (http only for loopback) - cap LLM error bodies echoed in LlmStatus via preview_raw - cora-review workflow: require pinned CORA_BASE_URL secret Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: ajianaz <[email protected]>
3 of 4 tasks
ajianaz
added a commit
that referenced
this pull request
Oct 8, 2026
) Covers security hardening (#563, #572, #573), fixes (#553, #561, #562, #564, #565, #574-#576), and the ignore-pattern semantic changes from #577 that can alter which files existing configs exclude. Signed-off-by: ajianaz <[email protected]> Co-authored-by: ajianaz <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 8, 2026
Merged
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.
What
Stops a repo-controlled
.cora.yamlfrom redirecting the LLM API key (Bearer token) to an attacker host, plus related hardening.Why
A discovered project
.cora.yamlcould setprovider.base_url;chat_completionthen POSTsAuthorization: Bearer <key>there. Incora-review.yml(pull_request_target+ PR-head checkout +CORA_API_KEY) any PR author could exfiltrate the secret. Validation also allowedhttp://,ws://,unix:, and API error bodies were echoed unbounded.How
provider.base_urlfrom a discovered.cora.yamlis dropped with a warning unlessCORA_TRUST_PROJECT_CONFIG=1. CLI--base-url,CORA_BASE_URL, global config, and explicit--configare unaffected. A project value equal to the already-resolved one is kept silently.check_base_url:https://required;http://only forlocalhost/127.0.0.1/[::1](userinfo tricks likehttp://localhost@evilrejected). Used byConfig::validateand re-checked on the final URL inbuild_llm_config(covers env/preset URLs). Breaking:ws:///unix:/remotehttp://now error clearly.CoraError::LlmStatus.bodynow goes throughpreview_raw(512 bytes) in both the blocking and streaming paths.cora-review.yml: new first step fails if theCORA_BASE_URLsecret is empty. Since envCORA_BASE_URLoverrides project config, the key can no longer be redirected by a PR's.cora.yaml, even with the older action binary.docs/usage.md.Testing
cargo test --features tree-sitterpassescargo fmt --all -- --checkpassescargo clippy --all-targets --features tree-sitter -- -D warningspassescargo build --release --features tree-sitterpasses (not run; dev check/test build fine)New tests: project-only base_url ignored when untrusted; used when trusted; equal value kept; http non-loopback/userinfo/ws/unix rejected, loopback + https accepted; LlmStatus body capped.
Not done (deliberate)
permissionsleft unchanged (security-events: writemay be needed for SARIF). Fully fixing means checking out base and fetching the head diff, which should be coordinated withcora-review-action.Related Issues
Security hardening (no public issue).
Checklist
security/)develop🤖 Generated with Claude Code