CVE-2021-39391: Github.com/beego/beego/v2 Cross-Site Scripting Vulnerability
MODERATECVE-2021-39391 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-64: Windows Shortcut Following (.LNK)) affecting Github.com/beego/beego/v2 libraries in the Go ecosystem. The issue involves cross-site scripting in beego. Remediation is available by upgrading affected packages to version 2.0.2.
CVE-2021-39391 at a Glance
Security Impact
CVSS: 6.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:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-39391
To remediate this vulnerability, upgrade all affected Github.com/beego/beego/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/beego/beego/v2 to 2.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/beego/beego/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-39391, inspect your project dependencies for Github.com/beego/beego/v2:
inspect dependencies for github.com/beego/beego/v2
Analyze the terminal output to locate any version of Github.com/beego/beego/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.2), 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-64: Windows Shortcut Following (.LNK), where the product, when opening a file or directory, does not sufficiently handle when the file is a windows shortcut (.lnk) whose target is outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Github.com/beego/beego/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-2021-39391 Affected Github.com/beego/beego/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/beego/beego/v2
|
Go |
< 2.0.2
|
2.0.2
|
References
Frequently Asked Questions
What is CVE-2021-39391?
Which Github.com/beego/beego/v2 versions are affected?
What version fixes CVE-2021-39391?
Is github.com/beego/beego/v2 affected?
What is the CVSS score of CVE-2021-39391?
What CWE is associated with CVE-2021-39391?
How can I check Go dependencies for CVE-2021-39391?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c77f-4rgj-jfr4",
"modified" : "2023-12-07T23:44:35Z",
"published" : "2021-09-15T20:23:28Z",
"aliases" : [ "CVE-2021-39391" ],
"summary" : "Cross-site Scripting in Beego",
"details" : "Cross Site Scripting (XSS) vulnerability exists in the admin panel in Beego v2.0.1 via the URI path in an HTTP request, which is activated by administrators viewing the \"Request Statistics\" page.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/beego/beego/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39391"
}, {
"type" : "WEB",
"url" : "https://github.com/beego/beego/issues/4727"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/beego/beego"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-64", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-15T18:12:59Z",
"nvd_published_at" : "2021-09-14T18:15:00Z"
}
}