Skip to content

馃悰 fix: match selected security policies by exact path - #5199

Open
bilaldeveloper4312 wants to merge 1 commit into
ossf:mainfrom
bilaldeveloper4312:fix/security-policy-exact-path
Open

馃悰 fix: match selected security policies by exact path#5199
bilaldeveloper4312 wants to merge 1 commit into
ossf:mainfrom
bilaldeveloper4312:fix/security-policy-exact-path

Conversation

@bilaldeveloper4312

Copy link
Copy Markdown

Fixes #5198\n\nSecurity-Policy first discovers an approved policy path, but its content pass previously allowed a basename fallback. An unrelated nested security.md could therefore be read instead of the selected policy.\n\nThis adds an ExactPath option to the shared matcher and uses it only for Security-Policy content reads, preserving existing basename fallback behavior for other callers.\n\nValidation:\n- go test ./checks/fileparser ./checks/raw (Go 1.26.1, GitHub Codespaces)

Signed-off-by: Muhammad Bilal Mukhtar <designbybilal9@gmail.com>
@bilaldeveloper4312
bilaldeveloper4312 requested a review from a team as a code owner August 26, 2026 06:23
@bilaldeveloper4312
bilaldeveloper4312 removed the request for review from a team August 26, 2026 06:23
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 26, 2026
@bilaldeveloper4312 bilaldeveloper4312 changed the title fix: match selected security policies by exact path 馃悰 fix: match selected security policies by exact path Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

BUG: Security-Policy scores the contents of an unrelated security.md found elsewhere in the tree

1 participant