Repository navigation
fix: gate case-study link targets on a cncf.io host allow-list - #501
Merged
Merged
Conversation
scripts/collect-case-studies.mjs copies the cncf.io WordPress API's post.link into data/case-studies.json verbatim, and src/components/CaseStudies renders every one as an <a href> under a CNCF organization name. The only gate was an /^https:\/\// prefix test, which accepts any host and accepts a userinfo component that resolves to a hostile host while reading as CNCF in a diff. Parse the URL and hold the host to a cncf.io allow-list, matching the standard scripts/lib/profile-image.mjs already applies to profile images. Closes #500 Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "sec-check" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fix
scripts/collect-case-studies.mjscopies the cncf.io WordPress REST API'spost.linkintodata/case-studies.jsonverbatim, andsrc/components/CaseStudies/index.js:190renders every one of them as<a href={study.url} target="_blank">under a CNCF organization name on/resources/case-studies. The only gate between the two was an/^https:\/\//prefix test inscripts/validate-case-studies.mjs, whichis not a host check. Verified at
8c089a0:This change parses the URL instead and holds the host to a
cncf.ioallow-list, rejecting non-https, userinfo-bearing, and off-host targets — the
same standard
scripts/lib/profile-image.mjsalready applies to the profileimages published beside them. A rejected entry now names the offending value so
a maintainer can act on it, while the existing
missing or duplicate urlandsourceUrl must be an https URLwording is preserved for the cases thosealready describe.
All 211 URLs currently in
data/case-studies.jsonare onwww.cncf.io, so theallow-list is a no-op for today's data and only catches drift.
Verification
npm run validate:case-studies—Validated 211 case studies, clean on real data.node --test tests/validate-case-studies.test.mjs— 14/14 pass (7 added: off-host,prefix-only host, userinfo spoof and non-https, for both
sourceUrland entryurl, plus an accepted apex-cncf.iocase).npm run test:unit— 554 tests / 498 pass / 54 fail, against a8c089a0baseline of 547 / 491 / 54 fail in the same sandbox: +7 tests, +7 passing,
identical pre-existing failure count, no regression.
npx prettier --check scripts/validate-case-studies.mjs tests/validate-case-studies.test.mjs— clean.Disjointness
Touches exactly two files:
scripts/validate-case-studies.mjsandtests/validate-case-studies.test.mjs. No shared helper is added or modified —the gate is local to the validator precisely so it cannot collide.
scripts/validate-radar-reports.mjs:45carries the identical weakness and isdeliberately excluded: open PR #496 claims that validator's entry-url check
("test: cover validate-radar-reports sourceUrl, title and entry-url checks").
Issue #500 records that remainder and says it should be filed and fixed
separately once #496 lands. No other open PR names either file here: #195/#212
cover imported architecture SVG/MDX, #266 project logos, #291
check:links,#225
tests/tools/coverage-report.mjs, #435ArchitectureFilters, #476pr-queue-hygiene, #479ProjectsBorn, #482GroupLinkStatus/PeopleFreshness,#486
CommunityPeople, #490ReferenceArchitectures.Closes #500 — that issue's scope is the case-studies validator only, and the
radar remainder it names is explicitly deferred to its own issue, so merging
this leaves nothing for #500 to track.
Filed by sec-check agent (ACMM L4/L5 — hold-gated mode). Hold-gated: human review required.
— hive: agent=sec-check backend=copilot model=claude-opus-5