CVE-2024-27319
Description
Versions of the package onnx before and including 1.15.0 are vulnerable to Out-of-bounds Read as the ONNX_ASSERT and ONNX_ASSERTM functions have an off by one string copy.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
ONNX versions ≤1.15.0 are vulnerable to an out-of-bounds read due to an off-by-one error in string copy within ONNX_ASSERT and ONNX_ASSERTM macros.
Description
Versions of the ONNX package before and including 1.15.0 contain an out-of-bounds read vulnerability. The root cause is an off-by-one error in the ONNX_ASSERT and ONNX_ASSERTM macro functions, which perform an incorrect string copy operation that can read one byte beyond the intended buffer [1].
Exploitation
The vulnerability is triggered when the assertion macros handle string arguments. An attacker may be able to craft input that causes the macros to process a string in a way that reads adjacent memory. The exact attack vector requires further analysis, but typical use of ONNX involves loading or processing model data, which could provide a path for a malicious input to reach these macros [2] [3].
Impact
A successful exploit could lead to an out-of-bounds read, potentially exposing sensitive memory contents. This could facilitate information disclosure or serve as a stepping stone for more complex attacks. The CVSS score has not been assigned by NVD at this time [1].
Mitigation
Users should update to a patched version of ONNX beyond 1.15.0. The issue is fixed in subsequent releases. Users unable to upgrade can apply vendor-provided patches or restrict inputs from untrusted sources as a workaround. Fedora has also issued a security update for the affected package [4].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
onnxPyPI | < 1.16.0 | 1.16.0 |
Affected products
3- osv-coords2 versions
< 1.23.0-r12+ 1 more
- (no CPE)range: < 1.23.0-r12
- (no CPE)range: < 1.16.0
- onnx/onnxv5Range: 0
Patches
108a399ba75a8Fix Out of bounds read due to lack of string termination in assert (#5918)
1 file changed · +10 −5
onnx/common/assertions.cc+10 −5 modified@@ -9,6 +9,7 @@ #include "onnx/common/assertions.h" +#include <array> #include <cstdarg> #include <cstdio> @@ -17,16 +18,20 @@ namespace ONNX_NAMESPACE { std::string barf(const char* fmt, ...) { - char msg[2048]; + constexpr size_t buffer_size = 2048; + std::array<char, buffer_size> msg{}; va_list args; va_start(args, fmt); - // Although vsnprintf might have vulnerability issue while using format string with overflowed length, - // it should be safe here to use fixed length for buffer "msg". No further checking is needed. - vsnprintf(msg, 2048, fmt, args); + + // use fixed length for buffer "msg" to avoid buffer overflow + vsnprintf(static_cast<char*>(msg.data()), msg.size() - 1, fmt, args); + + // ensure null-terminated string to avoid out of bounds read + msg.back() = '\0'; va_end(args); - return std::string(msg); + return std::string(msg.data()); } void throw_assert_error(std::string& msg) {
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-h8wv-9h96-m4hrghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-27319ghsaADVISORY
- github.com/onnx/onnx/commit/08a399ba75a805b7813ab8936b91d0e274b08287ghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/onnx/PYSEC-2024-223.yamlghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FGTBH5ZYL2LGYHIJDHN2MAUURIR5E7PYghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TFJJID2IZDOLFDMWVYTBDI75ZJQC6JOLghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FGTBH5ZYL2LGYHIJDHN2MAUURIR5E7PY/mitre
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TFJJID2IZDOLFDMWVYTBDI75ZJQC6JOL/mitre
News mentions
0No linked articles in our index yet.