Lucene search

K
githubGitHub Advisory DatabaseGHSA-WW7X-3GXH-QM6R
HistoryNov 28, 2023 - 6:52 p.m.

Validation of SignedInfo

2023-11-2818:52:19
CWE-345
GitHub Advisory Database
github.com
1
xml signature
verification
hash value
digestvalue
canonicalization
public key
security library
php bug

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

7 High

AI Score

Confidence

High

0.0005 Low

EPSS

Percentile

17.9%

Validation of an XML Signature requires verification that the hash value of the related XML-document (after any optional transformations and/or normalizations) matches a specific DigestValue-value, but also that the cryptografic signature on the SignedInfo-tree (the one that contains the DigestValue) verifies and matches a trusted public key.

Within the simpleSAMLphp/xml-security library (https://github.com/simplesamlphp/xml-security), the hash is being validated using SignedElementTrait::validateReference, and the signature is being verified in SignedElementTrait::verifyInternal

https://github.com/simplesamlphp/xml-security/blob/master/src/XML/SignedElementTrait.php:

afbeelding

What stands out is that the signature is being calculated over the canonical version of the SignedInfo-tree. The validateReference method, however, uses the original non-canonicalized version of SignedInfo.

Impact

If an attacker somehow (i.e. by exploiting a bug in PHP’s canonicalization function) manages to manipulate the canonicalized version’s DigestValue, it would be potentially be possible to forge the signature. No possibilities to exploit this were found during the investigation.

Affected configurations

Vulners
Node
simplesamlphpsaml2Match5.0.0-alpha.12
OR
simplesamlphpxml-securityMatch1.6.11

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

7 High

AI Score

Confidence

High

0.0005 Low

EPSS

Percentile

17.9%

Related for GHSA-WW7X-3GXH-QM6R