Skip to content

chore: update security-audit.yml#843

Open
hf-security-analysis[bot] wants to merge 1 commit into
mainfrom
security-fix/-github-workflows-security-audit-yml-1778535952
Open

chore: update security-audit.yml#843
hf-security-analysis[bot] wants to merge 1 commit into
mainfrom
security-fix/-github-workflows-security-audit-yml-1778535952

Conversation

@hf-security-analysis
Copy link
Copy Markdown
Contributor

@hf-security-analysis hf-security-analysis Bot commented May 11, 2026

Update .github/workflows/security-audit.yml workflow configuration.

cc @sayakpaul

Closes huggingface/tracking-issues#459

@hf-security-analysis hf-security-analysis Bot requested a review from danieldk as a code owner May 11, 2026 21:45
@hf-security-analysis hf-security-analysis Bot requested a review from paulinebm May 11, 2026 21:45
@hf-security-analysis hf-security-analysis Bot requested a review from drbh as a code owner May 11, 2026 21:45
Comment on lines -169 to +189
if grep -q "NO_FINDINGS" /tmp/audit_result.txt; then
# Validate LLM output format before trusting it
if grep -qE '^NO_FINDINGS$' /tmp/audit_result.txt && [ $(wc -l < /tmp/audit_result.txt) -eq 1 ]; then
echo "has_findings=false" >> "$GITHUB_OUTPUT"
echo "Security audit complete — no findings."
else
elif grep -qE '^\*\[' /tmp/audit_result.txt; then
# Output appears to contain findings in expected mrkdwn format
echo "has_findings=true" >> "$GITHUB_OUTPUT"
echo "Security audit complete — findings detected, notifying Slack."
else
# Output format is unexpected - possible prompt injection
echo "has_findings=true" >> "$GITHUB_OUTPUT"
echo "::error::LLM output format validation failed - possible prompt injection detected"
printf '*[ALERT]* LLM Security Audit Output Validation Failed\nThe AI analysis returned unexpected output format, which may indicate a prompt injection attack.\nRaw output length: %s bytes\n' "$(wc -c < /tmp/audit_result.txt)" > /tmp/audit_result.txt
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the version tagging and extraction of COMMIT_TITLE seem okay but the output validation bit seems incorrect/unnecessary.

sayakpaul added a commit that referenced this pull request May 12, 2026
@sayakpaul sayakpaul mentioned this pull request May 12, 2026
sayakpaul added a commit that referenced this pull request May 12, 2026
* pin version of the claude npm installtion.

* get security enhancement prompt from #843
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.

1 participant