Vulnerabilities in pkg:pypi/pyRdfa3

PACKAGE
Advisory Identifier: GHSA-894q-wpg5-mf2h
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pyRdfa3

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/pyRdfa3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-894q-wpg5-mf2h CVE-2022-4396 MODERATE pyRdfa3 Cross-site Scripting vulnerability

CVE-2022-4396 at a Glance

CVE Identifier CVE-2022-4396
GHSA Identifier GHSA-894q-wpg5-mf2h
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-707: Improper Neutralization
Affected Product PyRdfa3
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

pyRdfa3 fixed: 3.6.2
pip install pyRdfa3>=3.6.2
Verify Direct and Transitive Dependencies

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

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.

CVE-2022-4396 Affected PyRdfa3 Versions

1 component(s)
Fixed Versions:
3.6.2
Product / Package Ecosystem Affected Versions Fixed Version
pyRdfa3
PyPI
< 3.6.2
3.6.2

References

Frequently Asked Questions

What is CVE-2022-4396?
CVE-2022-4396 is a security vulnerability in PyRdfa3 involving pyRdfa3 Cross-site Scripting vulnerability under CWE-707: Improper Neutralization.
Which PyRdfa3 versions are affected?
Affected versions include releases prior to 3.6.2 across affected packages: pyRdfa3.
What version fixes CVE-2022-4396?
Upgrading to 3.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pyRdfa3 affected?
Yes, pyRdfa3 is affected in releases prior to 3.6.2. Upgrade your dependency to 3.6.2 or later.
What is the CVSS score of CVE-2022-4396?
CVE-2022-4396 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2022-4396?
CVE-2022-4396 is classified under CWE-707: Improper Neutralization (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.).
How can I check PyPI dependencies for CVE-2022-4396?
Run the dependency tree command: 'pip show pyRdfa3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}