CVE-2019-13126: Github.com/nats io/nats server/v2 Integer Overflow Or Wraparound Vulnerability
HIGHCVE-2019-13126 is a HIGH (CVSS 7.5) integer overflow or wraparound vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Github.com/nats io/nats server/v2 libraries in the Go ecosystem. The issue involves integer overflow or wraparound in nats server. Remediation is available by upgrading affected packages to version 2.2.0.
CVE-2019-13126 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2019-13126
To remediate this vulnerability, upgrade all affected Github.com/nats io/nats server/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/nats-io/nats-server/v2 to 2.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/nats-io/nats-server/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2019-13126, inspect your project dependencies for Github.com/nats io/nats server/v2:
inspect dependencies for github.com/nats-io/nats-server/v2
Analyze the terminal output to locate any version of Github.com/nats io/nats server/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Github.com/nats io/nats server/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2019-13126 Affected Github.com/nats io/nats server/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nats-server/v2
|
Go |
< 2.2.0
|
2.2.0
|
References
Frequently Asked Questions
What is CVE-2019-13126?
Which Github.com/nats io/nats server/v2 versions are affected?
What version fixes CVE-2019-13126?
Is github.com/nats-io/nats-server/v2 affected?
What is the CVSS score of CVE-2019-13126?
What CWE is associated with CVE-2019-13126?
How can I check Go dependencies for CVE-2019-13126?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jp4j-47f9-2vc3",
"modified" : "2023-09-29T16:33:59Z",
"published" : "2021-05-18T18:14:55Z",
"aliases" : [ "CVE-2019-13126" ],
"summary" : "Integer Overflow or Wraparound in NATS Server",
"details" : "An integer overflow in NATS Server before 2.2.0 allows a remote attacker to crash the server by sending a crafted request.\n\n### Specific Go Packages Affected\ngithub.com/nats-io/nats-server/v2/server",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-13126"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/pull/1053"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/pull/1441"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/commit/07ef71ff98f45f8c2711be4aeaf484610d891dda"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/commits/master"
}, {
"type" : "WEB",
"url" : "https://www.twistlock.com/labs-blog/finding-dos-vulnerability-nats-go-fuzz-cve-2019-13126"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-17T16:35:04Z",
"nvd_published_at" : "2019-07-29T17:15:00Z"
}
}