Skip to content

fix(review): hard-block generic secret assignments#5493

Closed
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-security-vulnerability-in-secret-scanning
Closed

fix(review): hard-block generic secret assignments#5493
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-security-vulnerability-in-secret-scanning

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Unknown-format assigned credentials (keyword-plus-quoted values like password = "long-random-service-secret") must not bypass the automated gate after placeholder filtering, otherwise real secrets can be merged unnoticed.
  • Prior change downgraded generic_secret_assignment to advisory only and created a security regression where committed passphrases/client secrets could slip through unless they matched a provider-specific regex.

Description

  • Restore generic_secret_assignment as a hard-blocking kind in HARD_SECRET_KINDS so placeholder-filtered generic assignments are treated as gate-blocking secrets (src/review/secret-patterns.ts).
  • Change PR-diff safety scanning to treat any hit from HARD_SECRET_KINDS (including generic assignments after filtering) as a secret_leak / critical finding and include exact locations (src/review/safety.ts).
  • Update content-lane scanning so in-submission generic assignments that clear placeholder filters close the submission as an embedded secret (with line citation); linked third-party bodies still surface as manual review (src/review/content-lane/security-scan.ts).
  • Update unit tests and expectations to match the new behavior and regenerate Cloudflare runtime types required by the lint/typegen check (test/unit/secret-patterns.test.ts, test/unit/content-lane-security-scan.test.ts, test/unit/safety-wiring.test.ts, worker-configuration.d.ts).

Testing

  • Ran the focused unit suites npx vitest run test/unit/secret-patterns.test.ts test/unit/content-lane-security-scan.test.ts test/unit/safety-wiring.test.ts and all tests in those suites passed.
  • Ran npm run typecheck and npm run cf-typegen / npm run cf-typegen:check to regenerate and validate worker types, and both checks completed successfully after regenerating worker-configuration.d.ts.
  • Ran the engine parity drift check npm run engine-parity:drift-check which completed OK for the engine twin pairs.
  • Attempted the full coverage run (npm run test:coverage) and the repo-wide coverage thresholds failed (project-wide coverage is intentionally strict and the targeted runs were used to validate behavior); npm audit --audit-level=moderate could not complete in this environment due to the registry endpoint returning 403.

Codex Task

@JSONbored JSONbored self-assigned this Jul 12, 2026
@JSONbored
JSONbored marked this pull request as draft July 12, 2026 23:09
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-12 23:23:14 UTC

7 files · 2 blockers · readiness 89/100 · CI failing · blocked

🛑 Suggested Action - Manual Review

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ❌ 2 blockers No AI review summary
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (draft PR; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 424 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 424 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 424 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Mark ready when done.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.42%. Comparing base (55f8fd1) to head (74409da).
⚠️ Report is 46 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5493      +/-   ##
==========================================
- Coverage   94.46%   94.42%   -0.04%     
==========================================
  Files         554      554              
  Lines       44426    44420       -6     
  Branches    14663    14661       -2     
==========================================
- Hits        41967    41944      -23     
- Misses       1784     1801      +17     
  Partials      675      675              
Flag Coverage Δ
shard-1 43.85% <100.00%> (-0.26%) ⬇️
shard-2 34.80% <33.33%> (+0.03%) ⬆️
shard-3 31.69% <100.00%> (+0.10%) ⬆️
shard-4 31.36% <33.33%> (-0.06%) ⬇️
shard-5 32.89% <0.00%> (-0.39%) ⬇️
shard-6 43.83% <100.00%> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/content-lane/security-scan.ts 100.00% <ø> (ø)
src/review/safety.ts 100.00% <100.00%> (ø)
src/review/secret-patterns.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored

Copy link
Copy Markdown
Owner Author

Closing as a regression, not a fix.

This reverts a deliberate, heavily-documented same-day fix: 5855f8adb (#5370, "stop generic_secret_assignment from auto-closing PRs", merged ~8h before this branch was opened) demoted generic_secret_assignment from a hard blocker to advisory-only, specifically because the SHAPE heuristic auto-closed a legitimate contributor PR twice in a row (#5341, then its resubmission #5346) — the latest of at least 8 documented prior false-positive incidents on this exact pattern (#2613, #3178, #3673, #3866, #4587, #4733, plus #5341/#5346).

Main already catches real leaks here — isPlaceholderSecretValue + looksLikeDescriptivePlaceholderPhrase — and a non-placeholder generic assignment still surfaces as a warning-severity advisory finding / manual content-lane verdict for human review. It's not silently ignored, just not auto-blocking. This PR moves generic_secret_assignment back into HARD_SECRET_KINDS, deletes the ADVISORY_ONLY_SECRET_KINDS export entirely, and flips scanSubmissionContent() back to verdict: "close" — reintroducing the exact auto-close-on-shape failure mode #5370 fixed.

The PR's own test diff is the clearest signal: it rewrites the describe block titled "generic_secret_assignment is advisory-only, never a hard blocker (#5346)" — a regression guard for the #5341/#5346 incidents — to assert the opposite, and deletes the test asserting ADVISORY_ONLY_SECRET_KINDS is disjoint from HARD_SECRET_KINDS.

No action needed; flagging for visibility.

@JSONbored JSONbored closed this Jul 12, 2026
@JSONbored
JSONbored deleted the codex/fix-security-vulnerability-in-secret-scanning branch July 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant