CVE-2021-39183: Github.com/owncast/owncast Cross-Site Scripting Vulnerability
HIGHCVE-2021-39183 is a HIGH (CVSS 8.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/owncast/owncast libraries in the Go ecosystem. The issue involves unsafe inline xss in pasting dom element into chat. Remediation is available by upgrading affected packages to version 0.0.9.
CVE-2021-39183 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:L).
How to Fix CVE-2021-39183
To remediate this vulnerability, upgrade all affected Github.com/owncast/owncast 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/owncast/owncast to 0.0.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/owncast/owncast
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-39183, inspect your project dependencies for Github.com/owncast/owncast:
inspect dependencies for github.com/owncast/owncast
Analyze the terminal output to locate any version of Github.com/owncast/owncast in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.9), 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/owncast/owncast, 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-39183 Affected Github.com/owncast/owncast Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/owncast/owncast
|
Go |
< 0.0.9
|
0.0.9
|
References
Frequently Asked Questions
What is CVE-2021-39183?
Which Github.com/owncast/owncast versions are affected?
What version fixes CVE-2021-39183?
Is github.com/owncast/owncast affected?
What is the CVSS score of CVE-2021-39183?
What CWE is associated with CVE-2021-39183?
How can I check Go dependencies for CVE-2021-39183?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2hfj-cxw7-g45p",
"modified" : "2022-01-04T18:54:05Z",
"published" : "2021-12-14T21:48:16Z",
"aliases" : [ "CVE-2021-39183" ],
"summary" : "Unsafe inline XSS in pasting DOM element into chat",
"details" : "### Impact\n\nInline scripts are executed when Javascript is parsed via a paste action.\n\n1. Open https://watch.owncast.online/\n2. Copy and then paste `<img src=null onerror=alert('hello')>` into the\nchat field.\n3. An alert should pop up.\n\n### Patches\n```\n ⋮ 13 │ // Content security policy\n ⋮ 14 │ csp := []string{\n ⋮ 15 │ \"script-src 'self' 'sha256-2HPCfJIJHnY0NrRDPTOdC7AOSJIcQyNxzUuut3TsYRY='\",\n ⋮ 16 │ \"worker-src 'self' blob:\", // No single quotes around blob:\n ⋮ 17 │ }\n```\n\nWill be patched in 0.0.9 by blocking `unsafe-inline` Content Security Policy and specifying the `script-src`. The `worker-src` is required to be set to `blob` for the video player.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [owncast/owncast](https://github.com/owncast/owncast/issues)\n* Email us at [gabek@real-ity.com](mailto:gabek@real-ity.com)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/owncast/owncast"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.9"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/owncast/owncast/security/advisories/GHSA-2hfj-cxw7-g45p"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39183"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/owncast/owncast"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-12-14T20:16:10Z",
"nvd_published_at" : "2021-12-14T20:15:00Z"
}
}