Skip to content

NH-154954 Harden x-trace-options sig check - #922

Open
tammy-baylis-swi wants to merge 3 commits into
mainfrom
NH-154954-hmac-sig-check
Open

tammy-baylis-swi wants to merge 3 commits into
mainfrom
NH-154954-hmac-sig-check

Conversation

@tammy-baylis-swi

Copy link
Copy Markdown
Contributor

Implements a Copilot suggestion:

  • Hardened signature verification: trace-option signatures could use hmac.compare_digest instead of ordinary equality, and malformed/non-ASCII signatures should be rejected as bad signatures.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The tests leave malformed, non-ASCII, and invalid-type signature rejection unverified because the success-only mock bypasses the real comparator and would not catch a missing exception handler.

1 open issue
What changed in this PR

This PR hardens x-trace-options signature verification in the SolarWinds APM distribution.

Changes:

  • Replaces ordinary equality with hmac.compare_digest.
  • Returns Auth.BAD_SIGNATURE when comparison rejects malformed or non-ASCII signatures.
  • Adds a unit test verifying that signature validation calls the constant-time comparator.
File Description
tests/​unit/​test_oboe/​test_trace_options.py Adds a mocked test for comparator usage.
solarwinds_apm/​oboe/​trace_options.py Uses constant-time comparison and handles invalid signatures.

Review effort: Balanced

tammy-baylis-swi and others added 2 commits November 5, 2026 17:42
Add parameterized test for validating malformed signatures.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the signature-verification hardening change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@tammy-baylis-swi
tammy-baylis-swi marked this pull request as ready for review November 6, 2026 00:50
@tammy-baylis-swi
tammy-baylis-swi requested review from a team as code owners November 6, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants