Skip to content

Upstream 16257 - Harden log message output containing user input#244

Merged
cigamit merged 3 commits intomainfrom
upstream16257
Feb 28, 2026
Merged

Upstream 16257 - Harden log message output containing user input#244
cigamit merged 3 commits intomainfrom
upstream16257

Conversation

@cigamit
Copy link
Copy Markdown
Contributor

@cigamit cigamit commented Feb 28, 2026

Upstream Notes:
base64 encode user inputed url when logging so that newlines or other malicious payloads can't be injected into the log stream

@cigamit cigamit requested a review from TheWitness February 28, 2026 03:24
@cigamit cigamit self-assigned this Feb 28, 2026
Copilot AI review requested due to automatic review settings February 28, 2026 03:24
@cigamit cigamit added bug Something isn't working python Pull requests that update python code labels Feb 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens webhook notification logging to reduce the risk of log injection by encoding redirect URLs before they are written to logs.

Changes:

  • Base64-encodes redirect-related URLs before logging warning/error messages in the webhook notification backend.
  • Adds unit tests covering redirect handling (success, blank Location, max retries) and non-2xx responses.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
awx/main/notifications/webhook_backend.py Encodes redirect URLs for log-safe warning/error output during redirect handling.
awx/main/tests/unit/notifications/test_webhook.py Adds unit tests for redirect flows and error status handling in send_messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread awx/main/notifications/webhook_backend.py Outdated
Comment thread awx/main/notifications/webhook_backend.py
Comment thread awx/main/notifications/webhook_backend.py
Comment thread awx/main/tests/unit/notifications/test_webhook.py
@cigamit cigamit merged commit 1626cf6 into main Feb 28, 2026
@cigamit cigamit deleted the upstream16257 branch February 28, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code

Development

Successfully merging this pull request may close these issues.

3 participants