Skip to content

feat(enrichment): flag insecure HTTP security-header settings in iac-misconfig - #3538

Closed
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-insecure-http-headers-iac
Closed

feat(enrichment): flag insecure HTTP security-header settings in iac-misconfig#3538
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-insecure-http-headers-iac

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Summary

Adds three zero-FP HTTP security-header rules to the existing iac-misconfig analyzer (same pattern as #3387):

kind Trigger
coop-unsafe-none Cross-Origin-Opener-Policy set to unsafe-none
x-xss-protection-off X-XSS-Protection explicitly disabled (0)
frame-options-allowall X-Frame-Options set to ALLOWALL

Each rule requires its own header token on the same line as the weakening value, so unrelated lines (e.g. Cache-Control: max-age=0, bare unsafe-none = false) are not flagged.

No linked issue — small, self-contained enrichment rule batch on an existing analyzer with table + near-miss tests.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • 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, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint — not applicable (review-enrichment only)
  • npm run typecheck — not applicable (review-enrichment only)
  • npm run test:coverage — not applicable (review-enrichment only)
  • npm run test:workers — not applicable
  • npm run build:mcp — not applicable
  • npm run test:mcp-pack — not applicable
  • npm run ui:openapi:check — not applicable
  • npm run ui:lint — not applicable
  • npm run ui:typecheck — not applicable
  • npm run ui:build — not applicable
  • npm audit --audit-level=moderate — not applicable
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Review-enrichment-only change; validated with npm --prefix review-enrichment run build and node --test review-enrichment/test/iac-misconfig.test.ts (22/22 pass). analyzer-metadata.json unchanged (no registry descriptor changes).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — no UI changes.

Notes

  • Negative tests cover secure header counterparts and near-misses (Cache-Control max-age=0, bare unsafe-none config key).
  • X-XSS-Protection regex accepts both colon form (X-XSS-Protection: 0) and nginx add_header form (add_header X-XSS-Protection "0").

…misconfig

Add three zero-FP rules for COOP unsafe-none, disabled X-XSS-Protection, and X-Frame-Options ALLOWALL on the existing iac-misconfig analyzer.

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.

@luciferlive112116
luciferlive112116 force-pushed the feat/enrichment-insecure-http-headers-iac branch from 127e25c to 4a3be05 Compare July 5, 2026 16:17
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-05 16:19:33 UTC

4 files · 1 AI reviewer · 3 blockers · readiness 73/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.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
  • AI reviewers agree on a likely critical defect: This PR has no linked issue and self-declares the batch 'small enough' to skip one — but per the repo's contribution policy, that exception is for maintainers to grant, not contributors to assert
  • open or link an eligible issue before merge. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
Adds three HTTP security-header detection rules (`coop-unsafe-none`, `x-xss-protection-off`, `frame-options-allowall`) following the exact pattern of the six existing header rules above them in `iac-misconfig.ts`. All three regexes require the header-name token on the same line as the weakening value (matching the comment-block contract at line 109–112); the kind union in `types.ts` is extended, the `render.ts` switch covers all three new arms (exhaustiveness enforced by TypeScript's no-default pattern), and both positive and bare-value near-miss negative tests are provided. The implementation is mechanically correct and introduces no wiring breaks.

Blockers

  • This PR has no linked issue and self-declares the batch 'small enough' to skip one — but per the repo's contribution policy, that exception is for maintainers to grant, not contributors to assert; open or link an eligible issue before merge.
Nits — 6 non-blocking
  • `X-XSS-Protection: 0` is the modern recommended setting for suppressing the buggy legacy IE/Chrome XSS filter (OWASP and MDN both advise it over `1`), so `x-xss-protection-off` will fire on intentionally-hardened configs; either note this in the render.ts description (e.g. 'legacy filter disabled — verify this is intentional') or document the intentional FP trade-off in a comment next to `XSS_PROTECTION_OFF_RE` in `iac-misconfig.ts:117`.
  • `ALLOWALL` is not a valid `X-Frame-Options` value per RFC 7034 (only `DENY`, `SAMEORIGIN`, and deprecated `ALLOW-FROM` are defined); some non-standard implementations accept it, but the rule is low-signal — add a comment on `FRAME_OPTIONS_ALLOWALL_RE` at `iac-misconfig.ts:119` noting it targets non-standard implementations.
  • The comment on `XSS_PROTECTION_OFF_RE` (line 116–118) calls out the `(?![0-9])` digit-continuation guard specifically, but `iac-misconfig.test.ts` has no near-miss case for `X-XSS-Protection: 10` or `X-XSS-Protection: 01`; add one to make the guard's behavior visible and regression-proof.
  • In `render.ts` for `x-xss-protection-off`, adjust the wording from 'disables the legacy XSS filter' to something like 'explicitly disables the legacy XSS auditor — confirm this is intentional (modern guidance often recommends `0` to suppress the buggy filter)' so the review note reads as advisory rather than a hard finding.
  • Add a near-miss test entry `["+ add_header X-XSS-Protection \"10\";", null]` (or equivalent negative assertion) to `iac-misconfig.test.ts` alongside the existing safe-header cases, exercising the `(?![0-9])` lookahead the comment already documents.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

Why this is blocked

  • This PR has no linked issue and self-declares the batch 'small enough' to skip one — but per the repo's contribution policy, that exception is for maintainers to grant, not contributors to assert; open or link an eligible issue before merge.
  • 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.
Signal Result Evidence
Code review ❌ 3 blockers 1 reviewer
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 (no linked issue context).
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: 166 registered-repo PR(s), 87 merged, 21 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 166 PR(s), 21 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: not available
  • Official Gittensor activity: 166 PR(s), 21 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • 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.

🟩 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 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected; Maintainer requires a linked issue; AI reviewers agree on a likely critical defect: This PR has no linked issue and self-declares the batch 'small enough' to skip one — but per the repo's contribution policy, that exception is for maintainers to grant, not contributors to assert; open or link an eligible issue before merge.). 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.

@loopover-orb loopover-orb Bot closed this Jul 5, 2026
loopover-orb Bot pushed a commit that referenced this pull request Jul 5, 2026
Add two zero-FP HTTP isolation header rules on the existing iac-misconfig analyzer, following #3387. Drops the X-XSS-Protection and X-Frame-Options ALLOWALL rules from the closed #3538 attempt per review feedback.

Co-authored-by: luciferlive112116 <291889058+luciferlive112116@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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