Conformance Check Failure
Check ID: SEC-004
Severity: MEDIUM
Category: Security
Date: 2026-02-14
Run ID: §22025666977
Problem Description
The conformance checker identified 29 handlers that accept body or content fields but do not implement content sanitization. This violates the Safe Outputs specification requirement that all user-facing content must be sanitized to prevent injection attacks and ensure safe rendering.
Security Impact: Without proper sanitization:
- Potential for cross-site scripting (XSS) via malicious markdown
- Script injection through HTML in markdown
- Link-based phishing attacks
- Markdown rendering exploits
Affected Handlers
Key handlers missing sanitization (29 total):
Critical Priority
High Priority (Close Operations)
Medium Priority (Other Operations)
Current Behavior
These handlers accept body fields and pass them directly to GitHub API without sanitization. While GitHub's markdown renderer provides some protection, the specification requires explicit sanitization for defense in depth.
Expected Behavior
Per the Safe Outputs specification, all handlers with body/content fields MUST:
- Sanitize content using approved sanitization functions
- Strip potentially dangerous HTML tags and attributes
- Validate and sanitize markdown constructs
- Escape user-controlled content appropriately
Remediation Steps
For each affected handler:
-
Import sanitization module:
const { sanitizeContent } = require('./sanitize_content_core.cjs');
-
Sanitize before API calls:
const sanitizedBody = sanitizeContent(body);
await octokit.issues.createComment({
body: sanitizedBody,
// ...
});
-
For existing sanitization helpers, ensure they're being called:
sanitize_content.cjs - General content sanitization
sanitize_output.cjs - Output sanitization
sanitize_incoming_text.cjs - Input sanitization
-
Add validation that sanitization occurred before API call
Verification
After remediation, verify the fix by running:
bash scripts/check-safe-outputs-conformance.sh
The check SEC-004 should pass for the remediated handlers.
References
- Safe Outputs Specification:
docs/src/content/docs/reference/safe-outputs-specification.md (Section: "SEC-004: Content Sanitization Required")
- Existing sanitization modules:
actions/setup/js/sanitize_*.cjs
- Conformance Checker:
scripts/check-safe-outputs-conformance.sh
Generated by Daily Safe Outputs Conformance Checker
Conformance Check Failure
Check ID: SEC-004
Severity: MEDIUM
Category: Security
Date: 2026-02-14
Run ID: §22025666977
Problem Description
The conformance checker identified 29 handlers that accept
bodyor content fields but do not implement content sanitization. This violates the Safe Outputs specification requirement that all user-facing content must be sanitized to prevent injection attacks and ensure safe rendering.Security Impact: Without proper sanitization:
Affected Handlers
Key handlers missing sanitization (29 total):
Critical Priority
add_comment.cjs- Adds comments without sanitizing bodyadd_workflow_run_comment.cjs- Workflow comments unsanitizedcreate_pr_review_comment.cjs- PR review comments unsanitizedHigh Priority (Close Operations)
close_issue.cjs- Close messages unsanitizedclose_pull_request.cjs- Close messages unsanitizedclose_discussion.cjs- Close messages unsanitizedclose_expired_issues.cjs- Expiration messages unsanitizedclose_expired_pull_requests.cjs- Expiration messages unsanitizedclose_expired_discussions.cjs- Expiration messages unsanitizedclose_older_issues.cjs- Close messages unsanitizedclose_older_discussions.cjs- Close messages unsanitizedMedium Priority (Other Operations)
add_reaction_and_edit_comment.cjscreate_missing_data_issue.cjscreate_missing_tool_issue.cjscheck_workflow_recompile_needed.cjsCurrent Behavior
These handlers accept
bodyfields and pass them directly to GitHub API without sanitization. While GitHub's markdown renderer provides some protection, the specification requires explicit sanitization for defense in depth.Expected Behavior
Per the Safe Outputs specification, all handlers with body/content fields MUST:
Remediation Steps
For each affected handler:
Import sanitization module:
Sanitize before API calls:
For existing sanitization helpers, ensure they're being called:
sanitize_content.cjs- General content sanitizationsanitize_output.cjs- Output sanitizationsanitize_incoming_text.cjs- Input sanitizationAdd validation that sanitization occurred before API call
Verification
After remediation, verify the fix by running:
The check SEC-004 should pass for the remediated handlers.
References
docs/src/content/docs/reference/safe-outputs-specification.md(Section: "SEC-004: Content Sanitization Required")actions/setup/js/sanitize_*.cjsscripts/check-safe-outputs-conformance.sh