Skip to content

Fix secure validation for fork skill submissions - #71

Closed
denial123789 wants to merge 1 commit into
block:mainfrom
sandbaseai:agent/fix-security-scanner
Closed

Fix secure validation for fork skill submissions#71
denial123789 wants to merge 1 commit into
block:mainfrom
sandbaseai:agent/fix-security-scanner

Conversation

@denial123789

@denial123789 denial123789 commented Aug 15, 2026

Copy link
Copy Markdown

What changed

  • Materialize a fork PR head with trusted git fetch/git worktree operations instead of asking actions/checkout to opt into unsafe checkout under pull_request_target.
  • Run the base branch's trusted validator against the untrusted ./pr data directory, rather than executing a fork-modified validator.
  • Diff the fetched PR ref from the trusted checkout so changed skill directories are detected correctly.
  • Remove the stray sks identifier at the end of scripts/skills-security-scan.mjs.

Why

Fork submissions currently stop before validation because actions/checkout rejects an untrusted fork checkout in a privileged pull_request_target run. Later steps then obscure the root cause with missing-report errors. Independently, the scanner writes its report and then throws:

ReferenceError: sks is not defined

The new flow keeps executable workflow and validation code on the trusted base revision. Fork content is materialized only as input data; the validator already rejects symlinks and unsafe file types.

Validation

  • YAML parsing for both changed workflow files
  • simulated fork diff detected multi-source-search
  • trusted base validator executed against the fork worktree — passed
  • trusted base scanner executed with --repo-root against the fork worktree — FAIL=0
  • node scripts/skills-security-scan.mjs — completed with a WARN report and no runtime exception
  • node scripts/validate-skills.mjs — 7 base skill directories validated
  • git diff --check

Closes #59.

Signed-off-by: liyb <lybing315@163.com>
@denial123789
denial123789 force-pushed the agent/fix-security-scanner branch from 22518bf to f510976 Compare August 15, 2026 13:15
@denial123789 denial123789 changed the title Fix security scanner runtime error Fix secure validation for fork skill submissions Aug 15, 2026
@sandbaseai sandbaseai closed this by deleting the head repository Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Fork pull request workflows cannot check out skill submissions

3 participants