Vulnerabilities in pkg:golang/github.com/v2fly/v2ray-core/v4
PACKAGECVE-2021-4070 is a CRITICAL (CVSS 9.1) off-by-one error vulnerability (CWE-193: Off-by-one Error) affecting Github.com/v2fly/v2ray core/v4 libraries in the Go ecosystem. The issue involves off-by-one error in v2fly/v2ray-core. Remediation is available by upgrading affected packages to version 4.44.0.
pkg:golang/github.com/v2fly/v2ray-core/v4
Vulnerability advisories affecting package pkg:golang/github.com/v2fly/v2ray-core/v4. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-4cxw-hq44-r344 | CVE-2021-4070 | CRITICAL | Off-by-one Error in v2fly/v2ray-core |
CVE-2021-4070 at a Glance
Security Impact
CVSS: 9.1
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:H/I:N/A:H).
How to Fix CVE-2021-4070
To remediate this vulnerability, upgrade all affected Github.com/v2fly/v2ray core/v4 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/v2fly/v2ray-core/v4 to 4.44.0
Upgrade github.com/v2fly/v2ray-core to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/v2fly/v2ray-core/v4
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-4070, inspect your project dependencies for Github.com/v2fly/v2ray core/v4:
inspect dependencies for github.com/v2fly/v2ray-core/v4
Analyze the terminal output to locate any version of Github.com/v2fly/v2ray core/v4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.44.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-193: Off-by-one Error, where a product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value. In Github.com/v2fly/v2ray core/v4, 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-2021-4070 Affected Github.com/v2fly/v2ray core/v4 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/v2fly/v2ray-core/v4
|
Go |
< 4.44.0
|
4.44.0
|
|
github.com/v2fly/v2ray-core
|
Go |
|
|
References
Frequently Asked Questions
What is CVE-2021-4070?
Which Github.com/v2fly/v2ray core/v4 versions are affected?
What version fixes CVE-2021-4070?
Is github.com/v2fly/v2ray-core/v4 affected?
Is github.com/v2fly/v2ray-core affected?
What is the CVSS score of CVE-2021-4070?
What CWE is associated with CVE-2021-4070?
How can I check Go dependencies for CVE-2021-4070?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4cxw-hq44-r344",
"modified" : "2022-03-03T19:17:50Z",
"published" : "2022-02-24T00:00:52Z",
"aliases" : [ "CVE-2021-4070" ],
"summary" : "Off-by-one Error in v2fly/v2ray-core",
"details" : "v2fly/v2ray-core prior to 4.44.0 is vulnerable to an off-by-one error. Indexing operations on arrays, slices, or strings should use an index at most one less than the length. If the index is checked for being less than or equal to the length (`<=`), instead of less than the length (`<`), the index could be out of bounds.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/v2fly/v2ray-core/v4"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.44.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/v2fly/v2ray-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 4.44.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4070"
}, {
"type" : "WEB",
"url" : "https://github.com/v2fly/v2ray-core/commit/c1af2bfd7aa59a4482aa7f6ec4b9208c1d350b5c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/v2fly/v2ray-core"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/8da19456-4d89-41ef-9781-a41efd6a1877"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-193" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-02-24T20:44:31Z",
"nvd_published_at" : "2022-02-23T20:15:00Z"
}
}