Skip to content

Commit 3c93152

Browse files
fix(security): scope CodeQL to authored code instead of the captured upstream evidence trees (#240)
The promotion PR (#236) is blocked by a CodeQL failure — "1 new alert including 1 high severity security vulnerability": js/incomplete-sanitization (high) specs/_vendor/mcp-spec-docs/snapshot.html:61 "This does not escape backslash characters in the input." That file is not our code. It is a verbatim captured copy of a modelcontextprotocol.io page, fetched by scripts/fetch-capture.py and committed as the EVIDENCE that the spec said what we claim it said on a given date. The alert is about bundled JavaScript inside someone else's documentation site. WHY THIS IS UNACTIONABLE BY CONSTRUCTION, NOT MERELY INCONVENIENT The only way to "fix" the alert is to edit a capture — which corrupts the provenance every drift comparison and every re-vendor decision depends on. It would also fail the gate added one commit ago (scripts/check-vendor-meta-integrity.py), which exists precisely to make an edited capture fail loudly against its recorded sha256. So the choices were: leave a permanent red on every promotion PR, edit evidence, or scope the scanner to code we actually author. The first is the failure mode this whole track keeps being repaired from — a red lane people learn to ignore — and the second is worse than the alert. WHAT CHANGED New .github/codeql-config.yml with paths-ignore for the capture tiers (specs/_vendor/**, archive/**, _vendor/**), wired via the init action's config-file. Nothing under those paths is imported, executed, packaged or served; the extractors read them as text. Chose a path-scoped config over dismissing the individual alert because the next captured page carrying bundled JS re-raises it, and over disabling security-extended because that would weaken the scanner on code we DO write. This narrows WHAT is scanned, not HOW strictly. Deliberately NOT excluded: scripts/, research/, and every workflow. Verified the exclusion hides no authored code — of 66 tracked .py/.js/.ts/.sh files, the only one now out of scope is specs/_vendor/mcp-schema-ts/snapshot.ts, itself a captured upstream schema. ALSO Corrected the workflow header, which still described CodeRabbit as the complementary reviewer. CodeRabbit is retired and, as of 2026-07-22, NO AI reviewer runs on this repo (Gemini sunset, Greptile dark). CodeQL owns security; correctness and design are the repo's own CI plus human review. Leaving that comment in place would keep implying a review layer that does not exist. Verified: both YAML files parse; the open-alert inventory is exactly one alert and it is in a captured file; audit-harness verify OK after init (1 hash line changed, the one workflow edited). The config's effect is confirmed by this PR's own CodeQL run. Co-authored-by: jeremylongshore <jeremylongshore@users.noreply.github.com>
1 parent 421cd24 commit 3c93152

3 files changed

Lines changed: 41 additions & 3 deletions

File tree

.github/codeql-config.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CodeQL configuration for intent-eval-lab.
2+
#
3+
# WHY THIS FILE EXISTS
4+
#
5+
# This repo deliberately commits THIRD-PARTY BYTES it did not write and must not
6+
# edit: the spec-drift capture tiers. `specs/_vendor/<surface>/snapshot.*` and
7+
# `archive/raw/**` are verbatim upstream pages fetched by scripts/fetch-capture.py
8+
# — HTML with bundled/minified JS, atom feeds, JSON schemas — retained as the
9+
# EVIDENCE that a spec said what we claim it said on a given date.
10+
#
11+
# CodeQL analysing them produces high-severity alerts about other people's
12+
# bundled JavaScript (e.g. js/incomplete-sanitization in
13+
# specs/_vendor/mcp-spec-docs/snapshot.html, a captured modelcontextprotocol.io
14+
# page). Those alerts are unactionable by construction, and worse than
15+
# unactionable: the only way to "fix" one is to edit a capture, which corrupts the
16+
# provenance record every drift comparison and every re-vendor decision depends on
17+
# — and scripts/check-vendor-meta-integrity.py exists precisely to make such an
18+
# edit fail loudly.
19+
#
20+
# So this is not weakening the scanner. It is scoping it to code this repo
21+
# AUTHORS and EXECUTES. Nothing under these paths is imported, executed, packaged
22+
# or served; the extractors read them as text.
23+
#
24+
# Deliberately NOT excluded: scripts/, research/, and every workflow — the code we
25+
# actually write stays fully in scope, on the security-extended suite.
26+
paths-ignore:
27+
- specs/_vendor/**
28+
- archive/**
29+
- _vendor/**

.github/workflows/codeql.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: CodeQL
22

33
# Security scanning ONLY (security-extended query suite — no quality/maintainability
4-
# queries). Code-quality, design, and correctness review is CodeRabbit's job (see
5-
# .coderabbit.yaml); the two are intentionally non-overlapping. Free on public repos.
4+
# queries). Free on public repos.
5+
#
6+
# The counterpart this comment used to name (CodeRabbit) is retired, and as of
7+
# 2026-07-22 NO AI reviewer runs on this repo — Gemini Code Assist is sunset and
8+
# Greptile is dark. CodeQL owns security; correctness and design review is the
9+
# repo's own CI (partner-name guard, spec-drift gates, projection freshness,
10+
# vendor-meta provenance, scripts/tests) plus human review.
611

712
on:
813
push:
@@ -39,6 +44,10 @@ jobs:
3944
languages: ${{ matrix.language }}
4045
build-mode: none
4146
queries: security-extended
47+
# Scopes analysis to code this repo authors and executes. The captured
48+
# upstream trees are third-party bytes retained as evidence and must
49+
# never be edited — see .github/codeql-config.yml for the full reasoning.
50+
config-file: ./.github/codeql-config.yml
4251
- name: Perform CodeQL Analysis
4352
uses: github/codeql-action/analyze@v3
4453
with:

.harness-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add245f35fb0dbd63d5ab475020bb367b53be4c611eb509d614c8a1f5ca8ea32 .audit-harness
66
d29a2e9b94f7fd94f4f8953314323f96ca424cbaa6a985f6783b48ee2feae0f8 .audit-harness/scripts/gherkin-lint.sh
77
9c588a980e89dbc9ea2bcf0992daff51ec72b926ecb1644e21838b9fc5c2883d .audit-harness/scripts/harness-hash.sh
88
5b912f59eeef3c9b5f7de98d8ae27a0d8b2eeb03411f34d9fa0e205d061b7f7f .github/workflows/ci.yml
9-
7342d70d8e4a3531262c71127b6c285406807b677cc8f404c580fed9ed5349f7 .github/workflows/codeql.yml
9+
a349d30f7da0d4f6d2b6c7b6011115b8c0e474a30f820bc1354a7efaa10b2c37 .github/workflows/codeql.yml
1010
a47735f905b1463c148d0b71f5db852beec873782be18b6d1e7a55ec54a1baf4 .github/workflows/doc-quality.yml
1111
592a86e79d00a0bbbaed2e20d2fba91aba6744baa4cfb8222ea41fe422543fce .github/workflows/e2e-integration.yml
1212
43194d2f4ce1c37f70b4db099262149a4cd28f541eaa363f73adf05801b89935 .github/workflows/harness-hash-verify.yml

0 commit comments

Comments
 (0)