Skip to content

Harden/xmlsecuritydsig static analysis - #287

Merged
robrichards merged 4 commits into
masterfrom
harden/xmlsecuritydsig-static-analysis
Aug 8, 2026
Merged

Harden/xmlsecuritydsig static analysis#287
robrichards merged 4 commits into
masterfrom
harden/xmlsecuritydsig-static-analysis

Conversation

@robrichards

Copy link
Copy Markdown
Owner

Harden/xmlsecuritydsig static analysis

Close SSRF via IPv4-mapped IPv6, fail closed on unknown transforms, tighten same-document Reference URIs, and fix enveloped-signature / Object C14N handling without always detaching Signature from the caller DOM.
Preserve the caller DOM and allow later references to resolve after an enveloped transform.
Narrow XPath results to DOMElement before attribute access, correct related PHPDocs, and guard failed queries so static analysis and runtime failure paths stay consistent.
@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Comment thread src/Utils/XPath.php
const LETTERS = '\w';
const EXTENDED_ALPHANUMERIC = '-\w\d\s_:\.';

/* Attribute names only — no whitespace or XPath operators. */

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.

What are you trying to filter here? XML-attributes? With optional prefix?

Reject a null/non-key argument before verification so KeyInfo cannot be relied on implicitly and the safe-by-default API contract stays intact.
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.75676% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.25%. Comparing base (3715eea) to head (f670ad7).

Files with missing lines Patch % Lines
src/XMLSecurityDSig.php 81.69% 54 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #287      +/-   ##
============================================
+ Coverage     69.97%   71.25%   +1.27%     
- Complexity      596      660      +64     
============================================
  Files             4        4              
  Lines          1542     1687     +145     
============================================
+ Hits           1079     1202     +123     
- Misses          463      485      +22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robrichards
robrichards merged commit bcafc27 into master Aug 8, 2026
14 checks passed
@robrichards
robrichards deleted the harden/xmlsecuritydsig-static-analysis branch August 8, 2026 10:06
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