Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. simplesamlphp/saml2
  4. ›
  5. CVE-2023-49087

CVE-2023-49087: Validation of SignedInfo

November 30, 2023 (updated December 6, 2023)

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:

Click to open external image
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

  • github.com/advisories/GHSA-ww7x-3gxh-qm6r
  • github.com/simplesamlphp/xml-security/blob/master/src/XML/SignedElementTrait.php
  • github.com/simplesamlphp/xml-security/commit/f509e3083dd7870cce5880c804b5122317287581
  • github.com/simplesamlphp/xml-security/security/advisories/GHSA-ww7x-3gxh-qm6r

Code Behaviors & Features

Detect and mitigate CVE-2023-49087 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

Version 5.0.0

Solution

Unfortunately, there is no solution available yet.

Impact 7.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-345: Insufficient Verification of Data Authenticity

Source file

packagist/simplesamlphp/saml2/CVE-2023-49087.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:04 +0000.