CVE-2022-39324: Github.com/grafana/grafana Grafana Spoofing OriginalUrl Of Snapshots Vulnerability
MODERATECVE-2022-39324 is a MODERATE (CVSS 6.7) grafana spoofing originalurl of snapshots vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/grafana/grafana libraries in the Go ecosystem. The issue involves grafana spoofing originalurl of snapshots. Remediation is available by upgrading affected packages to version 9.2.8, 8.5.16.
CVE-2022-39324 at a Glance
Security Impact
CVSS: 6.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L).
How to Fix CVE-2022-39324
To remediate this vulnerability, upgrade all affected Github.com/grafana/grafana 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/grafana/grafana to 9.2.8
Upgrade github.com/grafana/grafana to 8.5.16
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/grafana/grafana
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39324, inspect your project dependencies for Github.com/grafana/grafana:
inspect dependencies for github.com/grafana/grafana
Analyze the terminal output to locate any version of Github.com/grafana/grafana in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.2.8), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/grafana/grafana, 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-2022-39324 Affected Github.com/grafana/grafana Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/grafana/grafana
|
Go |
≥ 9.0.0
< 9.2.8
|
9.2.8
|
|
github.com/grafana/grafana
|
Go |
< 8.5.16
|
8.5.16
|
References
Frequently Asked Questions
What is CVE-2022-39324?
Which Github.com/grafana/grafana versions are affected?
What version fixes CVE-2022-39324?
Is github.com/grafana/grafana affected?
What is the CVSS score of CVE-2022-39324?
What CWE is associated with CVE-2022-39324?
How can I check Go dependencies for CVE-2022-39324?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4724-7jwc-3fpw",
"modified" : "2024-07-08T20:59:51Z",
"published" : "2024-05-14T22:29:26Z",
"aliases" : [ "CVE-2022-39324" ],
"summary" : "Grafana Spoofing originalUrl of snapshots",
"details" : "To create a snapshot (and insert an arbitrary URL) the built-in role Viewer is sufficient.\nWhen a dashboard is shared as a local snapshot, the following three fields are offered in the web UI for a user to fill out:\n• Snapshotname\n• Expire\n• Timeout(seconds)\nAfter the user confirms creation of the snapshot (i.e. clicks the ”Local Snapshot” button) an HTTP POST request is sent to the Grafana server. The HTTP request contains additional parameters that are not visible in the web UI. The parameter originalUrl is not visible in the web UI, but sent in the HTTP POST request.\n\nThe value of the originalUrl parameter is automatically generated. The purpose of the presented originalUrl parameter is to provide a user that views the snapshot the possibility to click on the button in the Grafana web UI and be presented with the dashboard that the snapshot was made out of.\n\nThe value of the originalUrl parameter can be arbitrarily chosen by a malicious user that creates the snapshot (Note: by editing the query thanks to a web proxy like Burp)\nWhen another user opens the URL of the snapshot, they will be presented with the regular web interface delivered by the trusted Grafana server. The issue here is that the ”Open original dashboard” button no longer points to the to the real original dashboard but to the attacker’s (injected) URL.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/grafana/grafana"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.2.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/grafana/grafana"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.5.16"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/grafana/grafana/security/advisories/GHSA-4724-7jwc-3fpw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39324"
}, {
"type" : "WEB",
"url" : "https://github.com/grafana/grafana/pull/60232"
}, {
"type" : "WEB",
"url" : "https://github.com/grafana/grafana/pull/60256"
}, {
"type" : "WEB",
"url" : "https://github.com/grafana/grafana/commit/239888f22983010576bb3a9135a7294e88c0c74a"
}, {
"type" : "WEB",
"url" : "https://github.com/grafana/grafana/commit/d7dcea71ea763780dc286792a0afd560bff2985c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/grafana/grafana"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-14T22:29:26Z",
"nvd_published_at" : "2023-01-27T23:15:00Z"
}
}