Repository navigation
fix: close the CodeQL alerts in shipped code - #24
Merged
Merged
Conversation
compile/merge.ts: pointers come from capability payloads and the lockfile, so a "__proto__", "constructor" or "prototype" segment is now refused before anything is written (it could change every object in the CLI process), and reads treat it as missing. Trailing newlines are trimmed with a loop: /\n+$/ took 57 s on 200k newlines. site: heading text comes from marked's text renderer instead of stripping tags with a regex, the Oracle escapes every regex metacharacter in technology words, and the fetch log compares the parsed hostname instead of searching the URL.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Default setup had left 11 CodeQL alerts open on code Sigil ships, since the first commits on 2026-11-01. Ten are fixed here with tests. The eleventh is a false positive; reasoning below.
compile/merge.ts__proto__,constructororprototypesegment is now refused with aMergeErrorbefore anything is written, whichsigil addreports as a conflict. Reads (get,revert,pruneContainers,mergeStatus) treat such a pointer as missing, and own-property checks replaceinand=== undefined. A key liketoStringcan still be used as a plain name.compile/merge.ts/\n+$/.site/src/lib/server/markdown.tsslugifynow receives plain text. The method page's anchors are unchanged (tested against the real METHODOLOGY).site/src/lib/oracle/intent.ts(used to throw.Observatory.tsxControls run: with the old
merge.ts, every new test fails. Trimming 200k newlines took 57 s, and the prototype writes pollutedObject.prototypebadly enough to break unrelated tests later in the run. With the fix, all 314 package tests pass. The old regex escaping throws onC(.#12 (shell command from environment,
lab/exec.ts) is a false positive. All four flows in the SARIF end inchild_process.spawnwithout a shell (docker cpandrm -rf --inside the sandbox), so argv is passed verbatim and a path cannot inject a command. The one script that embeds a path already quotes it (shellQuoteinlab/tree.ts). It should be dismissed as a false positive rather than worked around in code.Also verified: typecheck, lint (the 4 warnings are pre-existing in
lab/), and 11 site tests.