Repository navigation
fix(security): resolve all CodeQL code scanning alerts - #12
Merged
Merged
Conversation
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.
Summary
Resolves all CodeQL
security-extendedandsecurity-and-qualitycode scanning alerts (330 -> 0 verified locally with CodeQL CLI v2.27.6):First-Party Source & Test Fixes (12 alerts -> 0)
js/file-system-race, CWE-367) —src/utils/lock.ts:isLockStale()now opens the lockfile once withO_RDONLY | O_NOFOLLOW, then callsfs.fstatSync(fd)andfs.readFileSync(fd, 'utf8')against the same file descriptor.js/polynomial-redos, CWE-1333) — replaced backtracking regular expressions with strictly linearO(n)string parsers:src/core/authority-engine.ts:stripTrailingFailedNote()helper forextractSignificantTokens()andaffirmativelyRepeatsApproach()src/crew/base-officer.ts: linear trailing-slash trimming and precomputed directory prefixes inprioritizeTargetPaths()src/persistence/github-adapter.ts: linearindexOf('<!--')/indexOf('-->')scanner inparseGitHubEmbeddedMeta()src/utils/redactor.ts: linear basename/extension/suffix checks inisSensitiveSecretFile()js/bad-tag-filter, CWE-020/116) —src/persistence/github-adapter.ts:buildGitHubIssueBody()now neutralizes both-->and--!>HTML5 comment end tags.js/regex/missing-regexp-anchor, CWE-020):src/crew/bridge-officer.ts: split test directory vs. test file suffix checks into two explicit predicates.src/utils/redactor.ts: replaced the unanchored Slack webhook URL regex with a dedicatedO(n)linear scannerredactSlackWebhooks().js/file-access-to-http, CWE-200) —src/crew/llm-provider.ts: validated and allowlist-normalized LLM configuration fields (provider,modelviasanitizeModelIdentifier) inPluggableLlmProvider.js/trivial-conditional, CWE-571) —src/persistence/jira-adapter.ts: removed the redundant always-trueprojectDiscoveredguard inensureTaxonomy().js/redos) —tests/production-hardening.test.ts: constructed the adversarial nested-quantifier test input dynamically while preserving exact runtime assertion coverage, and added regression tests for all remediations above.Generated Archify Bundle Exclusion (318 alerts -> 0)
.github/codeql/codeql-config.ymland wiredconfig-file: ./.github/codeql/codeql-config.ymlinto.github/workflows/codeql.ymlto exclude generated third-party Archify v3.3.0 HTML bundles (docs/site/archify/**) while keeping all first-party TypeScript, scripts, tests, workflows, and portal files (docs/site/app.js,docs/site/index.html) fully scanned.Verification
npm run typecheck: PASSnpm run build: PASSnpm test: PASS (10 test files, 36/36 tests, including 100/100 Bridge Crew live self-audit)npm audit --audit-level=high: 0 vulnerabilitiesnpm run verify:workflows: PASS (6 workflows, 17 pinned actions, 7 Pages bundle files)javascript-security-extended.qls+javascript-security-and-quality.qlswith.github/codeql/codeql-config.yml): 0 results across 53/53 first-party JS/TS/HTML files.