CVE-2026-32313
xmlseclibs is Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption
xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Prior to 3.1.5, XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key. This vulnerability is fixed in 3.1.5.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
8.2
xmlseclibs is Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption
xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Prior to 3.1.5, XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key. This vulnerability is fixed in 3.1.5.
- Record
CVE-2026-32313- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-354
- Updated
- 2026-11-02
EUVDEUVD-2026-12094
8.2
xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Prior to 3.1.5, XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key. This vulnerability is fixed in 3.1.5.
- Record
EUVD-2026-12094- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-4v26-v6cg-g6f9
8.2
xmlseclibs: Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption
Summary
XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key.
Details
When decrypting with either aes-128-gcm, aes-192-gcm, or aes-256-gcm here, the $authTag is set from a substr(), but never has its length validated (it should be validated with something like strlen($authTag) == self::AUTHTAG_LENGTH).
For that reason, a shorter than expected data blob will allow for the $authTag to have as short a tag as only one byte (see PHP's documentation).
See this example:
function test($data) {
$ivSize = 12;
$tagSize = 16;
$iv = substr($data, 0, $ivSize);
$data = substr($data, $ivSize);
$offset = 0 - $tagSize;
$tag = substr($data, $offset);
$ct = substr($data, 0, $offset);
echo 'IV: "' . $iv . '"' . PHP_EOL;
echo 'Tag: "' . $tag . '"' . PHP_EOL;
echo 'CT: "' . $ct . '"' . PHP_EOL;
}
/* Outputs:
php > test('myNonceNoncet');
IV: "myNonceNonce"
Tag: "t"
CT: ""
php > test('myNonceNonceta');
IV: "myNonceNonce"
Tag: "ta"
CT: ""
php > test('myNonceNoncetag');
IV: "myNonceNonce"
Tag: "tag"
CT: ""
*/
With a legit ciphertext in hand, this is enough to recover the GHASH key. With that key, any authenticated tags can be computed offline which allows for decryption of the ciphertext and forgery of arbitrary ciphertexts.
PoC
- Setup a server expecting XML with an encrypted assertion
- Run this php script poc.php with
php -S 127.0.0.1:8888(taken from this saml test case) - The script expects this private key: sp-private-key.pem.
- Run this php script poc.php with
- Create an XML document with an encrypted assertion (encrypted with
aes-256-gcm)- Here is the
SAMLResponseused in the video below: saml_response.txt
- Here is the
Note: The steps from 3 to 6 are implemented in this exploit script: nonce_reuse_with_fmt_val_oracle.py.
You can run the script with sage -python nonce_reuse_with_fmt_val_oracle.py -s 'url-encoded_and_base64-encoded_samlresponse'
- Take the content of the
<xenc:CipherValue>node and apply the following modifications- Base64-decode the content
- Take the first 12 bytes and save them as the nonce
- Take the last 16 bytes and save them as the tag
- Now brute-force the tag of an empty ciphertext
- Loop through all 256 possible byte values (let's call that
byte_tag_attempt) - Concatenate together the nonce and the
byte_tag_attempt - Base64-encode the result
- Replace the content of the
<xenc:CipherValue>node with this…
- Loop through all 256 possible byte values (let's call that
- Record
GHSA-4v26-v6cg-g6f9- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-354
- Updated
- 2026-11-02
NVD
8.2
xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Prior to 3.1.5, XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key. This vulnerability is fixed in 3.1.5.
- Record
CVE-2026-32313- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-354
- Updated
- 2026-11-02
OSV
8.2
xmlseclibs is Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption
xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Prior to 3.1.5, XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key. This vulnerability is fixed in 3.1.5.
- Record
CVE-2026-32313- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-354
- Updated
- 2026-11-02
OSVGHSA-4v26-v6cg-g6f9
8.2
xmlseclibs: Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption
Summary
XML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length. An attacker can use this to brute-force an authentication tag, recover the GHASH key, and decrypt the encrypted nodes. It also allows to forge arbitrary ciphertexts without knowing the encryption key.
Details
When decrypting with either aes-128-gcm, aes-192-gcm, or aes-256-gcm here, the $authTag is set from a substr(), but never has its length validated (it should be validated with something like strlen($authTag) == self::AUTHTAG_LENGTH).
For that reason, a shorter than expected data blob will allow for the $authTag to have as short a tag as only one byte (see PHP's documentation).
See this example:
function test($data) {
$ivSize = 12;
$tagSize = 16;
$iv = substr($data, 0, $ivSize);
$data = substr($data, $ivSize);
$offset = 0 - $tagSize;
$tag = substr($data, $offset);
$ct = substr($data, 0, $offset);
echo 'IV: "' . $iv . '"' . PHP_EOL;
echo 'Tag: "' . $tag . '"' . PHP_EOL;
echo 'CT: "' . $ct . '"' . PHP_EOL;
}
/* Outputs:
php > test('myNonceNoncet');
IV: "myNonceNonce"
Tag: "t"
CT: ""
php > test('myNonceNonceta');
IV: "myNonceNonce"
Tag: "ta"
CT: ""
php > test('myNonceNoncetag');
IV: "myNonceNonce"
Tag: "tag"
CT: ""
*/
With a legit ciphertext in hand, this is enough to recover the GHASH key. With that key, any authenticated tags can be computed offline which allows for decryption of the ciphertext and forgery of arbitrary ciphertexts.
PoC
- Setup a server expecting XML with an encrypted assertion
- Run this php script poc.php with
php -S 127.0.0.1:8888(taken from this saml test case) - The script expects this private key: sp-private-key.pem.
- Run this php script poc.php with
- Create an XML document with an encrypted assertion (encrypted with
aes-256-gcm)- Here is the
SAMLResponseused in the video below: saml_response.txt
- Here is the
Note: The steps from 3 to 6 are implemented in this exploit script: nonce_reuse_with_fmt_val_oracle.py.
You can run the script with sage -python nonce_reuse_with_fmt_val_oracle.py -s 'url-encoded_and_base64-encoded_samlresponse'
- Take the content of the
<xenc:CipherValue>node and apply the following modifications- Base64-decode the content
- Take the first 12 bytes and save them as the nonce
- Take the last 16 bytes and save them as the tag
- Now brute-force the tag of an empty ciphertext
- Loop through all 256 possible byte values (let's call that
byte_tag_attempt) - Concatenate together the nonce and the
byte_tag_attempt - Base64-encode the result
- Replace the content of the
<xenc:CipherValue>node with this…
- Loop through all 256 possible byte values (let's call that
- Record
GHSA-4v26-v6cg-g6f9- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-354
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
robrichards/xmlseclibsPackagist |
before 3.1.5 | 3.1.5 |
robrichards/xmlseclibsPackagist |
before 3.1.5, plus listed versions 1.3.21.3.31.3.41.4.01.4.1 Show 16 moreShow less1.4.21.4.32.0.02.0.12.1.02.1.13.0.03.0.13.0.23.0.33.0.43.1.03.1.13.1.23.1.33.1.4 |
3.1.5 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-32313 is a high vulnerability (CVSS 8.2) in Robrichards Xmlseclibs, published March 13, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.16%, the 5th percentile. Fixed in robrichards/xmlseclibs 3.1.5.
References
github.com/robrichards/xmlseclibs/security/advisories/GHSA-4v26-v6cg-g6f9
github.com/robrichards/xmlseclibs/commit/03062be78178cbb5e8f605cd255dc32a14981f92
github.com/robrichards/xmlseclibs/releases/tag/3.1.5
nvd.nist.gov/vuln/detail/CVE-2026-32313
github.com/advisories/GHSA-4v26-v6cg-g6f9
github.com/CVEProject/cvelistV5/tree/main/cves/2026/32xxx/CVE-2026-32313.json
github.com/robrichards/xmlseclibs
Left out here: the rest of 2 source descriptions. The JSON record has them.