Skip to content

Stack Buffer Overflow via Unbounded Digest Copy During Signature Verification

High
mtrojnar published GHSA-hx87-8754-xvh4 Apr 9, 2026

Package

osslsigncode

Affected versions

< 2.12

Patched versions

2.12

Description

Description

A stack buffer overflow vulnerability exists in osslsigncode version 2.11 and earlier in several signature verification paths. During verification of a PKCS#7 signature, the code copies the digest value from a parsed SpcIndirectDataContent structure into a fixed-size stack buffer (mdbuf[EVP_MAX_MD_SIZE], 64 bytes) without validating that the source length fits within the destination buffer.

This pattern is present in the verification handlers for PE, MSI, CAB, and script files. An attacker can craft a malicious signed file with an oversized digest field in SpcIndirectDataContent. When a user verifies such a file with osslsigncode verify, the unbounded memcpy can overflow the stack buffer and corrupt adjacent stack state.

This report should not claim that all file-format verification handlers are affected. In particular, CAT verification does not trigger this specific bug in cat_verify_digests(), which returns success without parsing the digest. CAT code in the same release contains a similar unsafe digest copy in a different code path used for displaying catalog content, but that is distinct from the verification vulnerability described here.

Impact

  • Arbitrary Code Execution: Stack corruption during verification may enable code execution in the context of the user running osslsigncode
  • Denial of Service: Application crash when processing a malicious signed file

The attack requires user interaction (verifying a malicious signed file), but no special privileges are needed.

Notes

A proof-of-concept trigger is reported to exist. The upstream 2.12 release describes this issue as a critical memory corruption vulnerability that can lead to arbitrary code execution during verification of untrusted signed files.

Fixed in version 2.12: https://github.com/mtrojnar/osslsigncode/releases/tag/2.12

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2026-39853

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

Stack-based Buffer Overflow

A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). Learn more on MITRE.

Out-of-bounds Write

The product writes data past the end, or before the beginning, of the intended buffer. Learn more on MITRE.

Credits