Skip to content

Fix all 20 open code-scanning alerts - #1721

Open
mbouaziz wants to merge 3 commits into
mainfrom
vibe/fix-code-scanning-alerts-77663b
Open

mbouaziz wants to merge 3 commits into
mainfrom
vibe/fix-code-scanning-alerts-77663b

Conversation

@mbouaziz

Copy link
Copy Markdown
Contributor

Summary

Fixes all 20 open alerts on https://github.com/SkipLabs/skip/security/code-scanning. The alerts were enumerated by re-running the repo's exact CodeQL matrix (security-extended, same build modes as codeql.yml) on a temporary branch and reading the resulting SARIF (the code-scanning REST API is not accessible from this integration).

  • 15x actions/unpinned-tag — the third-party docker actions in docker-publish.yml, docker-publish-skdb.yml and docker-retag-latest.yml are now pinned to commit SHAs (docker/setup-buildx-action v4.4.1, docker/login-action v4.8.0, docker/bake-action v7.5.0). First-party actions/*/github/* uses are trusted by the query and left on tags.
  • 1x js/missing-origin-check (sql/ts/src/skdb_worker.ts) — the browser worker's message handler now drops events whose origin does not match the worker script's own origin. The worker is only ever created same-origin from the embedding page (new Worker(new URL("./skdb_worker.js", import.meta.url)) in browser.ts), so this is defense-in-depth with no behavior change for legitimate callers.
  • 2x cpp/path-injection (skiplang/prelude/runtime/palloc.c) — false positive: the only flow is the local runtime CLI opening the --data/--init state.db path from its own argv. Excluded via query-filters in a new .github/codeql/codeql-config.yml.
  • 2x js/missing-rate-limiting (skipruntime-ts/examples/database-server.ts) — localhost-only example server; excluded via paths-ignore in the same config file.

The config file is wired in through config-file: in codeql.yml because codeql-action does not auto-load .github/codeql/codeql-config.yml. Config-level filters are the effective mechanism here: GitHub code scanning ignores SARIF suppressions, and in-code codeql[...] comments do nothing unless the AlertSuppression query is added to the run.

Verification

  • Re-ran the full CodeQL matrix (security-extended, same build modes) on this branch via a temporary SARIF-dump workflow: 20 results before, 0 after, across javascript-typescript, python, java-kotlin, c-cpp and actions. The temporary workflow was removed again; this branch contains only the three fix commits. The security-extended suite itself still runs (only the two false-positive rules/paths above are filtered).
  • YAML-validated all edited workflow files; pin SHAs resolved from the upstream tags with git ls-remote.

Note (unrelated, left untouched): the scheduled CodeQL Advanced run's c-cpp job currently fails on infra — on ubuntu-latest (26.04 "resolute") apt.llvm.org has no llvm-toolchain-resolute-20 suite, and the manual runtime build drops -I. from CFLAGS, so ryu/d2s.c cannot find ryu/ryu.h.

AI disclosure

This PR was prepared with AI assistance (Mistral Vibe, mistral-large-4-0); the commits carry a Co-Authored-By trailer accordingly.

mistral-vibe and others added 3 commits November 19, 2026 23:04
Fixes the 15 actions/unpinned-tag code-scanning alerts in
docker-publish.yml, docker-publish-skdb.yml and docker-retag-latest.yml:
docker/setup-buildx-action -> v4.4.1, docker/login-action -> v4.8.0,
docker/bake-action -> v7.5.0. First-party actions/* and github/* uses
are trusted by code scanning and left on tags.

Co-Authored-By: Mistral Vibe (mistral-large-4-0) <vibe@mistral.ai>

Co-authored-by: mbouaziz <mbouaziz@users.noreply.github.com>
Fixes the js/missing-origin-check code-scanning alert on the
postmessage handler in skdb_worker.ts. The worker is only created
same-origin from the embedding page, so drop messages whose origin
does not match the worker script's own origin.

Co-Authored-By: Mistral Vibe (mistral-large-4-0) <vibe@mistral.ai>

Co-authored-by: mbouaziz <mbouaziz@users.noreply.github.com>
Add .github/codeql/codeql-config.yml and point codeql.yml at it via
config-file (the action does not auto-load it). The config keeps the
security-extended suite and:
- excludes cpp/path-injection: the only hits are the local runtime CLI
  opening the --data/--init state.db path from its own argv in
  palloc.c, which the local user already controls;
- paths-ignores the localhost-only database-server example, where
  js/missing-rate-limiting is not exploitable.

Config-level filters are the effective mechanism here: GitHub code
scanning ignores SARIF suppressions, and in-code codeql[...] comments
do nothing unless the AlertSuppression query runs.

Co-Authored-By: Mistral Vibe (mistral-large-4-0) <vibe@mistral.ai>

Co-authored-by: mbouaziz <mbouaziz@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mbouaziz
mbouaziz marked this pull request as ready for review November 19, 2026 23:53
@mbouaziz
mbouaziz enabled auto-merge November 19, 2026 23:53

This branch has not been deployed

No deployments
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.

3 participants