Repository navigation
fix(security): validate every generated community-people section, not just rostered ones - #725
Closed
hivecommons-hive[bot] wants to merge 1 commit into
Closed
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
… just rostered ones scripts/validate-community-people.mjs drove its person-level loop from data/community-roster.json's section keys, while src/components/CommunityPeople renders data/community-people.json's. A section present only in the generated file therefore skipped every check in the loop body, including the profileImageUrl() host gate, and reached <img src> with an arbitrary host. The loop now runs over the union of both files' section keys, and a generated section the roster does not declare is an error in its own right. Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@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 |
Member
|
Superseded by #753, which consolidates the six open security-fix PRs (commits cherry-picked unmodified, authorship and DCO preserved). |
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/validate-community-people.mjsis the only gate CI runs ondata/community-people.json, and the only thing standing between an unattendedupstream refresh and an arbitrary third-party host in an
<img src>served toevery visitor of
/communityand/community/technical-advisory-board.Its person-level loop was driven by the roster's section keys:
while
src/components/CommunityPeople/index.js:134renders the generatedfile's:
Any section key in
data/community-people.jsonthatdata/community-roster.jsondid not declare therefore skipped the entire loop body — no name check, no
profile-link check, and no
profileImageUrl()host gate.Verified against
main@b54cf81, adding anambassadorssection with"image": "https://evil.example/beacon.png":Exit 0 — and the summary counted the profile it never checked (17 reported, 16
actually validated). The identical value inside
tabis rejected.The two files agree on their keys today (
staff,tab), so this was a latenthole, not a live exposure. It opens the moment a roster section is renamed or
removed while the generated section survives, or a new section arrives from the
unattended
cncf/peoplerefresh — neither of which produced any CI signal.What this changes
Files touched:
scripts/validate-community-people.mjs,tests/validate-community-people.test.mjs.section the site can render is checked.
(
section is not declared in community-roster.json), reported once for thesection rather than once per member.
missing roster member/is not on the roster) still only applies within a declared section, so itsexisting messages are unchanged.
instead of throwing.
The closing
Validated N community profilesline is now honest:Nalreadycounted
data.peopleflattened, and every one of those profiles has nowactually been through the checks.
No data changes.
data/community-people.jsonanddata/community-roster.jsonpass unchanged — this is a gate-only change.
Behaviour change to an existing test
tests/validate-community-people.test.mjspreviously asserted, undertreats a roster with no sections as having nothing to cross-check, that agenerated file whose two sections are both absent from the roster exits 0.
That test encoded the hole. It is replaced by
rejects a generated section the roster does not declare, which expects the newsection error.
Verification
node --test tests/validate-community-people.test.mjs— 24 pass, 0 fail (5 new)node scripts/validate-community-people.mjson real repo data — exit 0,"Validated 16 community profiles"
ambassadorsprobe above now exits 1 with bothsection is not declared in community-roster.jsonandProbe image must be an https URL on an allowed hostTZ=UTC node tests/tools/coverage-report.mjs --check 97 --check-source 99—exit 0, src files 100.00% line / 97.95% region
prettier --checkon both changed files — cleanNew tests cover: an undeclared section being rejected, the image host gate
firing inside an undeclared section, the roster-membership error not being
repeated per member for an undeclared section, membership still being
cross-checked inside a declared section, and a null roster section list.
Closes #724
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 copilot=1.0.88