Skip to content

Fix CodeQL code-scanning alerts - #95

Merged
Adambomb210 merged 1 commit into
mainfrom
claude/security-alerts
Nov 19, 2026
Merged

Adambomb210 merged 1 commit into
mainfrom
claude/security-alerts

Conversation

@Adambomb210

Copy link
Copy Markdown
Collaborator

Fixes the 17 open code-scanning alerts on main (there are no Dependabot or secret-scanning alerts).

Stack trace exposure (#1, #2, #10, #11, #17, #18): DomainError now stores the text it was raised with as exc.message. Routers (and the NotAllowed/NotFound API handlers in app.py) send exc.message instead of str(exc), and only where the caught exception is a domain error. Responses carry the same words as before.

URL redirection (#5–#9, #14, #22): redirects to a project use project.id from the loaded row, not the project_id path parameter. Accepting an invitation redirects to (and posts the Slack invite for) the invitation's own project. compute_files.download_url signs the key of the file it found in the job's listing, not the requested name.

Workflow permissions (#15, #20): ci.yml declares permissions: contents: read at the top. The image job keeps its own packages: write.

Clear-text storage (#3, #4): both are in dev/test code that writes local secrets on purpose: SeaweedFS test keys in tests/live, and the dev OAuth secret in scripts/dev/weave_e2e_setup.py. The script now makes those files readable by the owner only. CodeQL will still flag them, so they should be dismissed as "used in tests" / "won't fix".

Tests: full suite locally, 2072 passed (excluding tests/live). Ruff check and format are clean. New tests/services/test_errors.py.

🤖 Generated with Claude Code

- Domain errors carry an explicit `message` (the text written for the person who hit it); routers send that back
  instead of `str(exc)` (py/stack-trace-exposure).
- Redirects to a project build the URL from the project loaded from the database, not the raw path parameter;
  accepting an invitation redirects to the invitation's own project (py/url-redirection).
- A job file's download URL is signed for the file found in the job's listing, not the requested name.
- CI workflow declares read-only `permissions` at the top (actions/missing-workflow-permissions).
- The dev Weave e2e setup script makes the files holding the dev OAuth secret readable by the owner only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Adambomb210
Adambomb210 merged commit 9344ff2 into main Nov 19, 2026
12 checks passed
Adambomb210 added a commit that referenced this pull request Nov 19, 2026
The updates router used the shared project redirect helpers with the raw path parameter, which kept CodeQL's
py/url-redirection alert #5 open after #95.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant