Skip to content

Fix HTTP proxy Basic Auth credential decoding#487

Open
sol-hermes85 wants to merge 1 commit into
thinkst:masterfrom
sol-hermes85:fix/httpproxy-basic-auth-decoding
Open

Fix HTTP proxy Basic Auth credential decoding#487
sol-hermes85 wants to merge 1 commit into
thinkst:masterfrom
sol-hermes85:fix/httpproxy-basic-auth-decoding

Conversation

@sol-hermes85

Copy link
Copy Markdown

Summary

Fixes Basic Auth credential decoding in the HTTP proxy module.

base64.b64decode() returns bytes under Python 3, but the existing code splits with a string delimiter. That raises an exception, is swallowed, and causes valid Basic Auth credentials to be logged as Invalid auth-token submitted.

This PR:

  • decodes the Basic Auth token before splitting
  • splits on the first colon only, preserving passwords that contain :
  • updates the HTTP proxy test to assert the captured username/password values

Testing

  • uvx pre-commit run --all-files
  • pytest opencanary/test/test_httpproxy.py -q

For the pytest run I started a minimal local OpenCanary instance with only the HTTP proxy enabled and logging to /var/tmp/opencanary.log, matching the integration test expectation.

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