Skip to content

Fix security scanning and evidence exports - #17

Merged
RNA4219 merged 7 commits into
mainfrom
agent/security-and-evidence-fixes
Aug 25, 2026
Merged

Fix security scanning and evidence exports#17
RNA4219 merged 7 commits into
mainfrom
agent/security-and-evidence-fixes

Conversation

@RNA4219

@RNA4219 RNA4219 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • update vulnerable root and fixture dependencies, including Vitest, Vite, PostCSS, js-yaml, fast-uri, brace-expansion, body-parser, and qs
  • add export sarif --scope security and upload only security-relevant findings to GitHub Code Scanning while retaining the full SARIF artifact
  • align the QEG gate fixture with the 0.2 pre-release evidence contract and stop synthesizing release approval evidence
  • exclude common Python caches and repository-local generated output from bounded discovery

Why

The repository had newly surfaced Dependabot alerts and was uploading maintainability findings as GitHub Security alerts. The QEG fixture also referenced future output paths and claimed producer-side approval that belongs to the authorized release workflow.

Impact

GitHub Code Scanning receives only auth, payment, validation, data, and security categories. Full SARIF remains available as an artifact. Root and demo fixture dependency installs audit cleanly, and QEG remains the final verdict owner.

Validation

  • npm run test:ci:stable: 3,579 passed, 4 skipped
  • targeted export/file-utils tests: 177 passed
  • fixture integration tests: 44 passed
  • demo fixture tests: shop 14 passed, GitHub Actions 3 passed, CI imports 1 passed, auth public-route tests passed
  • root and fixture audited installs: 0 known vulnerabilities
  • npm run release:validate: passed
  • QEG pinned CI runtime 0835903: validate and gate passed
  • workflow YAML parsing and git diff --check: passed

The demo GitHub Actions fixture intentionally retains its pre-existing failing build/typecheck/lint signals for CI-analysis coverage.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

code-to-gate PR Review

Gate Verdict

  • Status: needs_review
  • Readiness: passed
  • Findings: 16 total, 6 critical, 2 high

Blocking Reasons

  • No blocking reason was found.

Acceptable Risks

  • [info] Readiness verdict is passed: All policy conditions met, release ready
  • [info] No unsupported claims are present: LLM or imported claims that lack evidence are not present in findings.unsupported_claims.
  • [info] Public docs, CLI, schema, and schema coverage are aligned: 8 spec drift checks passed without failures.

Suggested Tests

  • [medium] Run src/tests/integration/export.test.ts: Test path matched changed source path. Command: npm test -- src/tests/integration/export.test.ts Source: test-plan-001, src/cli/export.ts
  • [medium] Run src/tests/performance/analyze-performance.test.ts: Test path matched changed source path. Command: npm test -- src/tests/performance/analyze-performance.test.ts Source: test-plan-002, src/cli/analyze.ts
  • [medium] Run src/tests/rules-all.test.ts: Test path matched changed source path. Command: npm test -- src/tests/rules-all.test.ts Source: test-plan-003, src/rules/index.ts
  • [medium] Run src/tests/smoke/real-repo-script-smoke.test.ts: Test path matched changed source path. Command: npm test -- src/tests/smoke/real-repo-script-smoke.test.ts Source: test-plan-004, src/tests/smoke/real-repo-script-smoke.test.ts
  • [medium] Run src/tests/smoke/rules-smoke.test.ts: Test path matched changed source path. Command: npm test -- src/tests/smoke/rules-smoke.test.ts Source: test-plan-005, src/rules/index.ts
  • [high] Run src/application/tests/rule-evaluator.test.ts: Test path matched changed source path. Command: npm test -- src/application/tests/rule-evaluator.test.ts Source: test-plan-006, src/application/tests/rule-evaluator.test.ts, src/application/rule-evaluator.ts
  • [medium] Run src/application/assurance/tests/diff-rules.test.ts: Test path matched changed source path. Command: npm test -- src/application/assurance/tests/diff-rules.test.ts Source: test-plan-007, src/rules/index.ts
  • [medium] Run src/cli/tests/analyze-imports-security.test.ts: Test path matched changed source path. Command: npm test -- src/cli/tests/analyze-imports-security.test.ts Source: test-plan-008, src/cli/analyze.ts
  • [medium] Run src/cli/tests/analyze.test.ts: Test path matched changed source path. Command: npm test -- src/cli/tests/analyze.test.ts Source: test-plan-009, src/cli/analyze.ts
  • [medium] Run src/cli/tests/export-generators.test.ts: Test path matched changed source path. Command: npm test -- src/cli/tests/export-generators.test.ts Source: test-plan-010, src/cli/export.ts
  • [high] Define expected behavior for .gitleaks.toml and add a focused regression or manual black-box check.: No related automated test was found for this changed source file. Source: oracle-gap-001, .gitleaks.toml
  • [high] Define expected behavior for scripts/real-repo-test-contract.sh and add a focused regression or manual black-box check.: No related automated test was found for this changed source file. Source: oracle-gap-002, scripts/real-repo-test-contract.sh
  • [high] Define expected behavior for scripts/real-repo-test.sh and add a focused regression or manual black-box check.: No related automated test was found for this changed source file. Source: oracle-gap-003, scripts/real-repo-test.sh
  • [high] Define expected behavior for src/config/policy-types.ts and add a focused regression or manual black-box check.: No related automated test was found for this changed source file. Source: oracle-gap-004, src/config/policy-types.ts
  • [high] Define expected behavior for src/types/rule-options.ts and add a focused regression or manual black-box check.: No related automated test was found for this changed source file. Source: oracle-gap-005, src/types/rule-options.ts

Spec Drift

  • No spec drift was found or no spec-drift artifact was provided.

Drift Budget

  • No drift budget summary is available.

Evidence Links

  • Release readiness: .qh/release-readiness.json schema: release-readiness@v1 hash: 903b5f7ba4fae267
  • Findings: .qh/findings.json schema: findings@v1 hash: 8422cb0fccffec0f
  • Auto test plan: .qh/test-plan.json schema: test-plan@v1 hash: f40e1bc8181bc89d
  • Spec drift: .qh/spec-drift.json schema: spec-drift@v1 hash: 7c5f0dbc5cd080e0
  • Evidence DAG: .qh/evidence-dag.json schema: evidence-dag@v1 hash: 61b20b688bf2174a
  • QEG evidence input: .qh/qeg-code-to-gate.json schema: ctg.qeg-input/v1 hash: 06577768f3140f99
  • Published quality report: https://github.com/RNA4219/code-to-gate/actions/runs/32794246091

Suppression / Baseline Summary

  • No baseline summary is available.

Gate Explainability

  • No gate explainability summary is available.

Generated by code-to-gate v1.5.1

@RNA4219
RNA4219 marked this pull request as ready for review August 25, 2026 01:26
@RNA4219
RNA4219 merged commit aab3d8c into main Aug 25, 2026
15 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53897b912b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/your[_-]?(?:key|token|secret)/i,
/replace[_-]?(?:me|with)/i,
/change[_-]?me/i,
/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not treat every uppercase underscore value as safe

When a real credential is formatted as uppercase segments—for example, const password = "PROD_DB_SECRET_8F31C7A942"—this new pattern makes isSafeValue return true, so the assignment check silently skips the hardcoded secret. Environment-variable-name placeholders should be distinguished more narrowly rather than exempting every sufficiently long uppercase underscore string.

Useful? React with 👍 / 👎.

const ROUTE_PATTERNS_BY_LANG: Record<string, RegExp[]> = {
ts: [
/\.(?:get|post|put|delete|patch)\s*\(\s*["'`]([^"'`]+)["'`]/g,
/\b(?:app|router|server|api|fastify|express|[A-Za-z_$][\w$]*(?:App|Router|Server))\s*\.\s*(?:get|post|put|delete|patch)\s*\(\s*["'`]([^"'`]+)["'`]/g,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recognize common plural router aliases

For Express code using a common alias such as const routes = express.Router(); routes.post('/auth/login', handler), the restricted receiver expression no longer matches because routes/authRoutes is neither an exact listed name nor suffixed with Router. Consequently, sensitive endpoints without rate limiting disappear from this security rule's results; the receiver detection should also cover established router aliases or derive them from router construction.

Useful? React with 👍 / 👎.

// Buffer
{ pattern: /new\s+Buffer\s*\(/g, name: "new Buffer()", replacement: "Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe()" },
{ pattern: /(?<![\w$.])Buffer\(\s*\)/g, name: "Buffer()", replacement: "Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe()" },
{ pattern: /\bBuffer\(\s*\)/g, name: "Buffer()", replacement: "Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe()" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep qualified Buffer methods out of the deprecated API match

When application code defines or invokes an unrelated qualified method such as codec.Buffer(), the new word-boundary pattern matches the Buffer() suffix and reports it as the deprecated Node global. The previous negative lookbehind excluded member access while already rejecting ArrayBuffer, so the replacement should preserve that qualification check.

Useful? React with 👍 / 👎.

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.

1 participant