CVE-2019-1020019: Invenio previewer Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-j9m2-6hq2-4r3c
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2019-1020019 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Invenio previewer libraries in the PyPI ecosystem. The issue involves cross-site scripting in invenio-previewer. Remediation is available by upgrading affected packages to version 1.0.0a12.

CVE-2019-1020019 at a Glance

CVE Identifier CVE-2019-1020019
GHSA Identifier GHSA-j9m2-6hq2-4r3c
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Invenio previewer
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
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-2019-1020019

To remediate this vulnerability, upgrade all affected Invenio previewer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

invenio-previewer fixed: 1.0.0a12
pip install invenio-previewer>=1.0.0a12
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 invenio-previewer

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2019-1020019, inspect your installed packages using pip:

pip show invenio-previewer

Analyze the terminal output to locate any version of Invenio previewer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0a12), your application is affected.

Note: The pip show invenio-previewer command checks currently installed packages in your active Python environment.

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 Invenio previewer, 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

## Cross-Site Scripting (XSS) vulnerability in JSON, Markdown and iPython Notebook previewers ### Impact Several Cross-Site Scripting (XSS) vulnerabilities have been found in the JSON, Markdown and iPython Notebook previewers. The vulnerabilities would allow a malicous user to upload a JSON, Markdown or Notebook file with embedded scripts that would be executed by a victims browser. ### Patches Invenio-Previewer v1.0.0a12 fixes the issue. ### Workarounds You can remediate the vulnerability without upgrading by disabling the affected previewers. You do this by adding the following to your configuration: ```python PREVIEWER_PREFERENCE = [ 'csv_dthreejs', 'simple_image', # 'json_prismjs', 'xml_prismjs', # 'mistune', 'pdfjs', # 'ipynb', 'zip', ] ``` Afterwards, you should not be able to preview JSON, Markdown or iPython Notebook files. ### For more information If you have any questions or comments about this advisory: * Email us at [info@inveniosoftware.org](mailto:info@inveniosoftware.org)

CVE-2019-1020019 Affected Invenio previewer Versions

1 component(s)
Fixed Versions:
1.0.0a12
Product / Package Ecosystem Affected Versions Fixed Version
invenio-previewer
PyPI
< 1.0.0a12
1.0.0a12

References

Frequently Asked Questions

What is CVE-2019-1020019?
CVE-2019-1020019 is a security vulnerability in Invenio previewer involving Cross-site Scripting in invenio-previewer under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Invenio previewer versions are affected?
Affected versions include releases prior to 1.0.0a12 across affected packages: invenio-previewer.
What version fixes CVE-2019-1020019?
Upgrading to 1.0.0a12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is invenio-previewer affected?
Yes, invenio-previewer is affected in releases prior to 1.0.0a12. Upgrade your dependency to 1.0.0a12 or later.
What is the CVSS score of CVE-2019-1020019?
CVE-2019-1020019 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2019-1020019?
CVE-2019-1020019 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check PyPI dependencies for CVE-2019-1020019?
Run the dependency tree command: 'pip show invenio-previewer'. 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-j9m2-6hq2-4r3c",
  "modified" : "2024-09-23T17:04:05Z",
  "published" : "2019-07-16T00:52:22Z",
  "aliases" : [ "CVE-2019-1020019" ],
  "summary" : "Cross-site Scripting in invenio-previewer",
  "details" : "## Cross-Site Scripting (XSS) vulnerability in JSON, Markdown and iPython Notebook previewers\n\n### Impact\nSeveral Cross-Site Scripting (XSS) vulnerabilities have been found in the JSON, Markdown and iPython Notebook previewers. The vulnerabilities would allow a malicous user to upload a JSON, Markdown or Notebook file with embedded scripts that would be executed by a victims browser.\n\n### Patches\nInvenio-Previewer v1.0.0a12 fixes the issue.\n\n### Workarounds\nYou can remediate the vulnerability without upgrading by disabling the affected previewers. You do this by adding the following to your configuration:\n\n```python\nPREVIEWER_PREFERENCE = [\n    'csv_dthreejs',\n    'simple_image',\n    # 'json_prismjs',\n    'xml_prismjs',\n    # 'mistune',\n    'pdfjs',\n    # 'ipynb',\n    'zip',\n]\n```\n\nAfterwards, you should not be able to preview JSON, Markdown or iPython Notebook files.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [info@inveniosoftware.org](mailto:info@inveniosoftware.org)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "invenio-previewer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0a12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.0a11"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/inveniosoftware/invenio-previewer/security/advisories/GHSA-j9m2-6hq2-4r3c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-1020019"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-j9m2-6hq2-4r3c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/inveniosoftware/invenio-previewer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/invenio-previewer/PYSEC-2019-26.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:42:56Z",
    "nvd_published_at" : null
  }
}