Skip to content

Conversation

@mackowski
Copy link
Owner

Potential fix for https://github.com/mackowski/10xGitHubPolicies/security/code-scanning/12

To fix this problem, we need to ensure that user-supplied data (body) written to logs does not contain log-forging characters such as newlines or carriage returns (\n, \r). This can be achieved by removing them or replacing them with safe representations. Implement a helper method (e.g., SanitizeForLog) that strips out these characters or replaces them with escaped versions, and use this method when logging the payload. The change should be made on line 127 inside the file 10xGitHubPolicies.App/Controllers/WebhookController.cs, replacing body with SanitizeForLog(body). If SanitizeForLog does not already handle multiline strings robustly, its implementation should be updated as necessary to sanitize arbitrary user-supplied strings.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…m user input

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mackowski mackowski marked this pull request as ready for review November 14, 2025 07:23
@github-actions
Copy link

🔍 Pull Request CI Status

✅ All checks passed

Test Results Summary

  • Total Tests: 290
  • Passed: 290
  • Failed: 0

Job Status

Job Status
Linting
Unit Tests
Component Tests
Integration Tests
Contract Tests

This comment is automatically updated on each workflow run.

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.

2 participants