-
Notifications
You must be signed in to change notification settings - Fork 232
Description
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
-
add_comment.cjs- Adds comments without sanitizing body -
add_workflow_run_comment.cjs- Workflow comments unsanitized -
create_pr_review_comment.cjs- PR review comments unsanitized
High Priority (Close Operations)
-
close_issue.cjs- Close messages unsanitized -
close_pull_request.cjs- Close messages unsanitized -
close_discussion.cjs- Close messages unsanitized -
close_expired_issues.cjs- Expiration messages unsanitized -
close_expired_pull_requests.cjs- Expiration messages unsanitized -
close_expired_discussions.cjs- Expiration messages unsanitized -
close_older_issues.cjs- Close messages unsanitized -
close_older_discussions.cjs- Close messages unsanitized
Medium Priority (Other Operations)
-
add_reaction_and_edit_comment.cjs -
create_missing_data_issue.cjs -
create_missing_tool_issue.cjs -
check_workflow_recompile_needed.cjs - 14 additional handlers (see conformance report)
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 sanitizationsanitize_output.cjs- Output sanitizationsanitize_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.shThe 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
- expires on Feb 15, 2026, 11:01 PM UTC