CVE-2022-4396: PyRdfa3 Cross-Site Scripting Vulnerability
MODERATECVE-2022-4396 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-707: Improper Neutralization) affecting PyRdfa3 libraries in the PyPI ecosystem. The issue involves pyrdfa3 cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 3.6.2.
CVE-2022-4396 at a Glance
Security Impact
CVSS: 5.4
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:L/A:N).
How to Fix CVE-2022-4396
To remediate this vulnerability, upgrade all affected PyRdfa3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pyRdfa3>=3.6.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pyRdfa3
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-4396, inspect your installed packages using pip:
pip show pyRdfa3
Analyze the terminal output to locate any version of PyRdfa3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.2), your application is affected.
Note: The pip show pyRdfa3 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-707: Improper Neutralization, where the product does not ensure or incorrectly ensures that structured messages or data are well-formed and that certain security properties are met before being read from an upstream component or sent to a downstream component. In PyRdfa3, 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-4396 Affected PyRdfa3 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pyRdfa3
|
PyPI |
< 3.6.2
|
3.6.2
|
References
Frequently Asked Questions
What is CVE-2022-4396?
Which PyRdfa3 versions are affected?
What version fixes CVE-2022-4396?
Is pyRdfa3 affected?
What is the CVSS score of CVE-2022-4396?
What CWE is associated with CVE-2022-4396?
How can I check PyPI dependencies for CVE-2022-4396?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-894q-wpg5-mf2h",
"modified" : "2024-04-08T17:20:47Z",
"published" : "2022-12-10T12:30:18Z",
"aliases" : [ "CVE-2022-4396" ],
"summary" : "pyRdfa3 Cross-site Scripting vulnerability",
"details" : "A vulnerability was found in RDFlib pyrdfa3 and classified as problematic. This issue affects the function `_get_option` of the file `pyRdfa/__init__.py`. The manipulation leads to cross site scripting. The attack may be initiated remotely. The name of the patch is ffd1d62dd50d5f4190013b39cedcdfbd81f3ce3e. It is recommended to apply a patch to fix this issue. The identifier VDB-215249 was assigned to this vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pyRdfa3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.6.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.5.3"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4396"
}, {
"type" : "WEB",
"url" : "https://github.com/RDFLib/pyrdfa3/issues/38"
}, {
"type" : "WEB",
"url" : "https://github.com/RDFLib/pyrdfa3/pull/40"
}, {
"type" : "WEB",
"url" : "https://github.com/RDFLib/pyrdfa3/commit/ffd1d62dd50d5f4190013b39cedcdfbd81f3ce3e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/RDFLib/pyrdfa3"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.215249"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-707", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-13T19:32:22Z",
"nvd_published_at" : "2022-12-10T12:15:00Z"
}
}