validate and remediate lowercase -f for susceptible gh fields (Pattern 2)#218
Conversation
|
Mac OS and Linux/CI are giving different prek results |
|
Hi @justinmclean — heads-up: this PR currently shows as conflicting against The conflicts are in I had a look at rebasing it on your behalf, but resolving how the new validator from this PR should coexist with the Pattern 4 infrastructure feels like a judgement call you should make rather than me guessing. Could you rebase against latest Thanks! |
|
Yep I will get to that sometime today |
|
Hi @justinmclean — heads-up first: Now the actual reason for this ping: this branch conflicts with Conflicting files:
Both conflicts are mechanical (additive on both sides), no semantic reconciliation needed. Let me know if you'd prefer me to push the resolution to your branch instead — I have maintainer-edit access if "Allow edits by maintainers" is enabled. |
|
I can rebase for you. just working on it |
4c5922c to
08c8b6b
Compare
|
@potiuk should be all good for you |
|
@justinmclean Another merge conflict here :) |
08c8b6b to
bb38d38
Compare
|
Rebasing :) |
bb38d38 to
89b7042
Compare
|
@choo121600 @potiuk should be good now |
|
Cool 👍 |
What
Adds a
validate_lowercase_f_fieldcheck to the skill-validator andremediates the two skills it flags.
skill-validator
New soft check (
lowercase-f-fieldcategory) that fires when a skill'sfenced code block contains a
ghcall using lowercase-fwith aninline quoted value on a susceptible field (
title,body,description,name,label,milestone). These fields commonlycarry attacker-controlled content; passing them as inline shell arguments
exposes them to shell-tokeniser injection.
Safe fields (
state,query,oid,type,sort) and the canonicalexample in
write-skill/security-checklist.mdare excluded. Prosementions outside fenced blocks are ignored. The check is soft — it warns
by default and only fails under
--strict.Closes the automated coverage gap for Pattern 2 in
write-skill/security-checklist.md.Skill remediations
security-issue-fix— milestone create call in § 9a now uses theWrite-tool-then-
-F field=@filepattern fortitleanddescription,consistent with
security-issue-import-from-pr.security-issue-sync— both the core/chart and provider-wavemilestone create calls updated the same way. The indented fenced blocks
here were not caught by the validator (pre-existing
_FENCED_CODE_REgap for indented fences), so this fix was applied manually after a
grep-based audit.-f state=openand-f due_on=are left as-f—stateis a staticframework value,
due_onis a date string not on the susceptible-fieldslist.
Tests
TestLowercaseFFieldSKILL.mdfiles — zero violations afterremediation
skill-evals/security-issue-sync/step-2b-proposed-changespromptconstruction verified: heading still resolves, updated
-Fpatternpresent, no fixture
expected.jsonfiles reference the changed bashcommands
Known gap
_FENCED_CODE_REdoes not match indented fenced blocks (e.g. fencesinside list items). The four matches in
security-issue-syncwere foundvia grep and fixed manually. A follow-up to generalise
_FENCED_CODE_REto handle up to 3 spaces of indentation (CommonMarkspec) would let the validator catch these automatically.