CVE-2023-49087
JSON

6.8medium

Validation of SignedInfo

Severity
6.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.24% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-ww7x-3gxh-qm6r

Description

xml-security is a library that implements XML signatures and encryption. Validation of an XML signature requires verification that the hash value of the related XML-document matches a specific DigestValue-value, but also that the cryptographic signature on the SignedInfo-tree (the one that contains the DigestValue) verifies and matches a trusted public key. 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 possible to forge the signature. This issue has been patched in version 1.6.12 and 5.0.0-alpha.13.

Affected

Product or packageVersionsReported by
simplesamlphp xml-security= 1.6.11, = 5.0.0-alpha.12, 1.6.11CVE List, NVD
simplesamlphp/xml-security (Packagist)from 1.6.11 before 1.6.12GitHub Advisory Database
simplesamlphp/saml2 (Packagist)from 5.0.0-alpha.12 before 5.0.0-alpha.13GitHub Advisory Database
simplesamlphp saml25.0.0NVD

All scores

GitHub_M6.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

What each source says

CVE List

xml-security is a library that implements XML signatures and encryption. Validation of an XML signature requires verification that the hash value of the related XML-document matches a specific DigestValue-value, but also that the cryptographic signature on the SignedInfo-tree (the one that contains the DigestValue) verifies and matches a trusted public key. 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 possible to forge the signature. This issue has been patched in version 1.6.12 and 5.0.0-alpha.13.

GitHub Advisory Database

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.

NVD (es)

xml-security es una librería que implementa cifrado y firmas XML. La validación de una firma XML requiere verificar que el valor hash del documento XML relacionado coincida con un valor DigestValue específico, pero también que la firma criptográfica en el árbol SignedInfo (el que contiene el DigestValue) verifique y coincida con una clave pública confiable. Si un atacante de alguna manera (es decir, explotando un error en la función de canonicalización de PHP) logra manipular el DigestValue de la versión canonicalizada, sería posible falsificar la firma. Este problema se solucionó en las versiones 1.6.12 y 5.0.0-alpha.13.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-49087 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-ww7x-3gxh-qm6r changed 2026-09-10CC-BY-4.0
NVDCVE-2023-49087 changed 2026-06-17Public domain