Skip to content

Enable code scanning, Dependabot, and close the first scan's findings - #40

Merged
lorem-dev merged 8 commits into
mainfrom
develop
Sep 8, 2026
Merged

lorem-dev merged 8 commits into
mainfrom
develop

Conversation

@lorem-dev

Copy link
Copy Markdown
Owner

Carries the security-tooling work from develop to main. Nine files, +333/-13, and nothing else -- no product changes, so CHANGES.md is untouched.

This merge is what actually starts Dependabot: it reads .github/dependabot.yml from the default branch, so until this lands the config exists but nothing runs.

What is in it

Code scanning (#38) -- CodeQL advanced setup with the security-and-quality suite. javascript-typescript and actions are blocking and run on pushes to main/develop, on every pull request, and weekly. Rust is advisory: it runs only on pushes to develop, both CodeQL steps are continue-on-error, and a trailing step turns a failure into a warning annotation, so it can never gate a merge. Neither job checks out examples/test-repo.

Dependabot (#38) -- github-actions, cargo and npm, all with target-branch: develop, weekly, minor and patch grouped into one pull request per ecosystem. dtolnay/rust-toolchain is ignored because it must move together with rust-toolchain.toml. Alerts and security updates are enabled on the repository.

Findings from the first scan (#39) --

  • All three ci.yml jobs and release.yml's verify-version/build ran on the default GITHUB_TOKEN; every job now declares its own grant, and publish is the only one that can write.
  • Five third-party actions pinned to commit SHAs. dtolnay/rust-toolchain@1.97.1 turned out to be an unprotected branch, not a tag -- the job that signs and publishes releases was running whatever its head happened to be.
  • js/polynomial-redos in packages/i18n/src/translator.ts: 40k opening braces took 2.3s, now sub-millisecond. Verified identical output across all 18 catalogs, so nothing user-visible changes.
  • js/file-system-race in scripts/release-downloads.mjs.

Editor (#38) -- .zed/settings.json silences the ESLint language server's diagnostic on files the flat config deliberately ignores.

The six Rust findings were dismissed with per-alert reasons (four used in tests, one won't fix for the PPK v2 zero IV, one false positive for the SSH_ASKPASS helper). One Dependabot alert was dismissed as tolerable_risk: glib is fixed in 0.20, but the latest tao and wry still need gtk ^0.18 and wry pins webkit2gtk =2.0.2, so no version of the Tauri v2 Linux stack depends on a patched glib.

Notes

lorem-dev and others added 8 commits August 24, 2026 21:02
chore: back-merge main into develop
CodeQL runs the security-and-quality suite over javascript-typescript
and actions on every push to main or develop, on every pull request, and
weekly. Neither extractor compiles anything, so the matrix costs a few
minutes. The actions extractor is the one that earns its keep here: it
reads the workflow files themselves and flags script injection in `run:`
blocks, which the release pipeline has a lot of surface for.

Rust gets a second job, advisory only and only on pushes to develop. Its
extractor is newer than the others and the workspace links a webview, so
a failure there says more about the extractor than about the code: both
CodeQL steps are continue-on-error and a trailing step turns a failure
into a warning annotation, which keeps the job from ever gating a merge
while still making a silently-broken scan visible.

Neither job checks out examples/test-repo. It is a fixture whose
contents are deliberately odd, and scanning it would fill the Security
tab with findings about code this repository does not ship.

Dependabot targets develop for all three ecosystems, because a bump
landing on main would be a direct commit to the release branch. Minor
and patch updates are grouped into one pull request per ecosystem;
ungrouped, three ecosystems would open roughly fifteen a week, each one
costing a full CI run. dtolnay/rust-toolchain is excluded: it is pinned
to an exact Rust version that has to move together with
rust-toolchain.toml, and a pull request bumping only the action would
recreate the desync that pin exists to prevent.

Two limits worth recording. Dependabot reads this config from the
default branch, so version updates start once the file reaches main.
Security updates are always opened against the default branch and
target-branch does not move them; backmerge.yml carries them into
develop.
eslint.config.mjs deliberately ignores scripts/, **/*.config.*, the
ts-rs-generated bindings and the examples/test-repo submodule. The
language server lints whatever file is open regardless, so opening one
of those put "File ignored because of a matching ignore pattern" on line
1 -- noise, not a finding.

The server derives ESLint's warnIgnored from onIgnoredFiles
(`onIgnoredFiles !== "off"`) and the editor does not send that key
unless a project setting names it, which leaves it undefined and so
truthy. Naming it is the whole fix.
ci: add codeql scanning and dependabot version updates
Closes the fourteen actions/* findings from the first CodeQL run.

Five jobs ran on the default GITHUB_TOKEN because neither their workflow
nor they declared permissions: all three in ci.yml, and release.yml's
verify-version and build. ci.yml gets one workflow-level `contents: read`,
which is the whole truth for it -- every job there checks out and runs a
gate. release.yml gets `permissions: {}` at the top and a grant per job,
so publish stays the only job that can write anything; build holds the
signing secrets and still needs nothing beyond read, because artifact
upload goes through the runner's own token rather than this one.

The five third-party actions move to commit SHAs with the version in a
trailing comment. dtolnay/rust-toolchain@1.97.1 is the one that matters
most and reads least like it: that ref is an unprotected BRANCH, not a
tag, so the release job that signs and publishes was running whatever
its head happened to be. tauri-action@v0 and rust-cache@v2 are moving
tags in the same pipeline. Dependabot keeps the SHAs and their comments
current for four of the five; rust-toolchain is excluded there and moves
by hand with rust-toolchain.toml, as before.

The actions/* uses stay on tags. GitHub publishes those immutably and
CodeQL does not flag them.
interpolate matched `\{([^}]+)\}`, whose body can cross an opening
brace. Every `{` in the template is therefore a candidate start that
scans to the end of the string before failing, which is quadratic: 20k
opening braces took 600ms and 40k took 2.3 seconds.

Excluding `{` from the body makes a failed start fail on its first
character, and the same 40k input now takes under a millisecond. Nothing
is lost, because a placeholder name never contains a brace -- and the
change is an improvement in its own right: a stray `{` in a
hand-authored catalog used to swallow the real placeholder behind it,
and now costs the author only that one brace.

No catalog is affected today. Running both patterns over every string in
all eighteen generated catalogs produces identical output, so this is a
guard against a future typo rather than a fix for a live one, and there
is nothing user-visible to record in the changelog.

Found by CodeQL (js/polynomial-redos).
`existsSync(notesPath) ? readFileSync(notesPath) : ''` asks a question
whose answer the read already carries, and leaves a window between the
two. Read it and treat ENOENT as "no notes yet"; anything else still
throws, which the old form would have swallowed as a missing file.

Found by CodeQL (js/file-system-race).
ci: close the CodeQL findings from the first scan
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@lorem-dev
lorem-dev merged commit 8b78345 into main Sep 8, 2026
13 checks passed
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.

2 participants