Skip to content

Validation of SignedInfo

High severity GitHub Reviewed Published Nov 27, 2023 in simplesamlphp/xml-security • Updated Dec 6, 2023

Package

composer simplesamlphp/saml2 (Composer)

Affected versions

= 5.0.0-alpha.12

Patched versions

5.0.0-alpha.13
composer simplesamlphp/xml-security (Composer)
= 1.6.11
1.6.12

Description

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.

References

@tvdijen tvdijen published to simplesamlphp/xml-security Nov 27, 2023
Published to the GitHub Advisory Database Nov 28, 2023
Reviewed Nov 28, 2023
Published by the National Vulnerability Database Nov 30, 2023
Last updated Dec 6, 2023

Severity

High
7.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Weaknesses

CVE ID

CVE-2023-49087

GHSA ID

GHSA-ww7x-3gxh-qm6r
Checking history
See something to contribute? Suggest improvements for this vulnerability.