Skip to content

feat(enrichment): flag CORP unsafe-none in iac-misconfig - #3682

Closed
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-corp-unsafe-none
Closed

feat(enrichment): flag CORP unsafe-none in iac-misconfig#3682
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-corp-unsafe-none

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Summary

Extend the IaC-misconfig HTTP security-header scanner with Cross-Origin-Resource-Policy: unsafe-none, matching the existing COOP/COEP unsafe-none rules. Includes positive/negative patch scans and render text.

Fixes #2096

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue.

Validation

  • git diff --check
  • npm run typecheck
  • review-enrichment: build + node --test test/iac-misconfig.test.ts (22/22 pass)
  • Full npm run test:coverage deferred to CI
  • New behavior has unit tests (positive case, secure counterpart, header-token boundary)

If any required check was skipped, explain why:

  • Remaining validation runs in GitHub Actions.

Safety

  • No secrets or private maintainer evidence exposed.
  • Public GitHub text stays sanitized and low-noise.
  • No auth/cookie/CORS/session changes.
  • No API/OpenAPI/MCP behavior changes.
  • No visible UI changes.

UI Evidence

N/A — enrichment analyzer rule only.

Notes

Incremental maintenance parity for the IaC-misconfig scanner (same 4-file shape as merged #3545). Avoids path-matcher / #561 duplicate churn.

Made with Cursor

Extend HTTP security-header coverage with Cross-Origin-Resource-Policy unsafe-none, matching the existing COOP/COEP rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 6, 2026
@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-06 03:34:53 UTC

4 files · 1 AI reviewer · 1 blocker · readiness 80/100 · CI green · clean

🛑 Suggested Action - Reject/Close

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

Review summary
This PR adds a `Cross-Origin-Resource-Policy: unsafe-none` detection rule to the IaC-misconfig scanner, mirroring the existing COOP/COEP `unsafe-none` rules exactly (same regex shape, same pushFinding/newLine control flow, same render.ts message pattern, same types.ts union addition). The change is small, mechanically correct, and includes positive, negative, and header-token-boundary tests consistent with the sibling rules already in the file. Issue #2096 is linked as required, and the diff matches the description with no scope creep.

Nits — 5 non-blocking
  • review-enrichment/src/analyzers/iac-misconfig.ts is already ~570 lines per the size-smell flag; this PR's incremental addition continues the long if-chain pattern rather than extracting the HTTP-header rules (HSTS/referrer/cookie/COOP/COEP/CORP) into a small {regex, kind} lookup table, which would cut repetition as more header rules are added.
  • Cannot verify from the truncated diff whether the render.ts switch has a default/exhaustiveness-check branch that needs updating for the new 'corp-unsafe-none' kind — worth a quick self-check that TypeScript's exhaustive switch (if any) still compiles without a fallback.
  • The negative-test comment update ('COOP/COEP/CORP') is a good touch, but consider also adding a case where CORP is set to a safe value (e.g. 'same-origin') on the same line as an unrelated 'unsafe-none' token elsewhere, to double-check the same-line boundary requirement mentioned in the header-rule doc comment.
  • review-enrichment/src/analyzers/iac-misconfig.ts: consider a shared `HEADER_RULES: Array<{re: RegExp, kind: IacMisconfigFinding["kind"]}>` array iterated once, since COOP/COEP/CORP (and HSTS/referrer/cookie) are now three near-identical blocks.
  • review-enrichment/src/render.ts: keep the corp-unsafe-none message wording consistent with COOP/COEP phrasing style ('disabling...' vs 'allowing...') for readability parity — currently fine but worth a glance given the pattern is now three-wide.

Why this is blocked

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2096
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 (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 173 registered-repo PR(s), 90 merged, 20 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 173 PR(s), 20 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: luciferlive112116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: JavaScript, MDX, Python, Rust, TypeScript
  • Official Gittensor activity: 173 PR(s), 20 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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.

🟩 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

@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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.

test(enrichment): unit coverage for the IaC-misconfig analyzer pure scanner

1 participant