CVE-2026-5187: Heap Out-of-Bounds Write in DecodeObjectId() in wolfSSL

Published Apr 9, 2026
·
Updated

Two potential heap out-of-bounds write locations existed in DecodeObjectId() in wolfcrypt/src/asn.c. First, a bounds check only validates one available slot before writing two OID arc values (out[0] and out[1]), enabling a 2-byte out-of-bounds write when outSz equals 1. Second, multiple callers pass sizeof(decOid) (64 bytes on 64-bit platforms) instead of the element count MAXOIDSZ (32), causing the function to accept crafted OIDs with 33 or more arcs that write past the end of the allocated buffer.

Affected Software

4 affected componentsFixes available
wolfSSL wolfCrypt
wolfSSL wolfssl<=5.9.0
alpine/wolfssl<5.9.1-r0
5.9.1-r0
alpine/wolfssl<5.9.1-r0
5.9.1-r0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade alpine/wolfssl to a version that resolves this vulnerability.

    Fixed in 5.9.1-r0
  2. Compensating control

    In wolfSSL DecodeObjectId(), require at least 2 output slots before writing the first split OID arc values (out[0] and out[1]) when y == 0.

  3. Compensating control

    Change DecodeObjectId() callers to pass the output element count MAX_OID_SZ rather than sizeof(decOid), preventing crafted OIDs with 33 or more arcs from writing beyond the allocated buffer.

Event History

Apr 9, 2026
CVE Published
via MITRE·07:45 PM
Data Sourced
via MITRE·07:45 PM
RemedyDescriptionWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·08:16 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-5187?

CVE-2026-5187 has been assigned a high severity rating due to the potential for heap out-of-bounds writes.

2

How do I fix CVE-2026-5187?

To fix CVE-2026-5187, update wolfSSL to version 5.10.0 or greater, which addresses the vulnerability.

3

Which versions of wolfSSL are affected by CVE-2026-5187?

CVE-2026-5187 affects all versions of wolfSSL up to 5.9.0 inclusive.

4

What components of wolfSSL are impacted by CVE-2026-5187?

The vulnerability is specifically found in the DecodeObjectId() function within the wolfCrypt library.

5

Can CVE-2026-5187 lead to exploitation?

Yes, CVE-2026-5187 can lead to potential arbitrary code execution or crashes if exploited.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203