Vulnerabilities in pkg:pypi/readthedocs-sphinx-search

PACKAGE
Advisory Summary

GHSA-xgfm-fjx6-62mj is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Readthedocs sphinx search libraries in the PyPI ecosystem. The issue involves readthedocs-sphinx-search vulnerable to cross-site scripting when including search results from malicious projects. Remediation is available by upgrading affected packages to version 0.3.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/readthedocs-sphinx-search

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/readthedocs-sphinx-search. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-xgfm-fjx6-62mj - MODERATE readthedocs-sphinx-search vulnerable to cross-site scripting when including search results from malicious projects

GHSA-xgfm-fjx6-62mj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xgfm-fjx6-62mj
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Readthedocs sphinx search
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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:U/C:H/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 Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-xgfm-fjx6-62mj

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

readthedocs-sphinx-search fixed: 0.3.2
pip install readthedocs-sphinx-search>=0.3.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 readthedocs-sphinx-search

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-xgfm-fjx6-62mj, inspect your installed packages using pip:

pip show readthedocs-sphinx-search

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

Note: The pip show readthedocs-sphinx-search 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 Readthedocs sphinx search, 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

### Impact This vulnerability could have allowed an attacker to include arbitrary HTML content in search results by having a user search a malicious project. This was due to our search client not correctly escaping all user content from search results. You can find more information in the [advisory published in our readthedocs.org repo](https://github.com/readthedocs/readthedocs.org/security/advisories/GHSA-qhqx-5j25-rv48). Users of this extension should update to the 0.3.2 version, and trigger a new build. This issue was discovered by a member of our team, and we have seen no signs that this vulnerability was exploited in the wild. ### Patches This issue has been patched in our 0.3.2 version. ### References - https://github.com/readthedocs/readthedocs-sphinx-search/commit/8c6f6d01e88e72ef32ed0c220b6c19d1e1121c73 ### For more information If you have any questions or comments about this advisory, email us at [security@readthedocs.org](mailto:security@readthedocs.org) ([PGP](https://docs.readthedocs.io/page/security.html#pgp-key))

GHSA-xgfm-fjx6-62mj Affected Readthedocs sphinx search Versions

1 component(s)
Fixed Versions:
0.3.2
Product / Package Ecosystem Affected Versions Fixed Version
readthedocs-sphinx-search
PyPI
< 0.3.2
0.3.2

References

Frequently Asked Questions

What is GHSA-xgfm-fjx6-62mj?
GHSA-xgfm-fjx6-62mj is a security vulnerability in Readthedocs sphinx search involving readthedocs-sphinx-search vulnerable to cross-site scripting when including search results from malicious projects under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Readthedocs sphinx search versions are affected?
Affected versions include releases prior to 0.3.2 across affected packages: readthedocs-sphinx-search.
What version fixes GHSA-xgfm-fjx6-62mj?
Upgrading to 0.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is readthedocs-sphinx-search affected?
Yes, readthedocs-sphinx-search is affected in releases prior to 0.3.2. Upgrade your dependency to 0.3.2 or later.
What is the CVSS score of GHSA-xgfm-fjx6-62mj?
GHSA-xgfm-fjx6-62mj has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with GHSA-xgfm-fjx6-62mj?
GHSA-xgfm-fjx6-62mj 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 GHSA-xgfm-fjx6-62mj?
Run the dependency tree command: 'pip show readthedocs-sphinx-search'. 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-xgfm-fjx6-62mj",
  "modified" : "2024-01-16T20:48:16Z",
  "published" : "2024-01-16T20:48:16Z",
  "aliases" : [ ],
  "summary" : "readthedocs-sphinx-search vulnerable to cross-site scripting when including search results from malicious projects",
  "details" : "### Impact\n\nThis vulnerability could have allowed an attacker to include arbitrary HTML content in search results by having a user search a malicious project. This was due to our search client not correctly escaping all user content from search results. You can find more information in the [advisory published in our readthedocs.org repo](https://github.com/readthedocs/readthedocs.org/security/advisories/GHSA-qhqx-5j25-rv48).\n\nUsers of this extension should update to the 0.3.2 version, and trigger a new build.\n\nThis issue was discovered by a member of our team, and we have seen no signs that this vulnerability was exploited in the wild.\n\n### Patches\n\nThis issue has been patched in our 0.3.2 version. \n\n### References\n\n- https://github.com/readthedocs/readthedocs-sphinx-search/commit/8c6f6d01e88e72ef32ed0c220b6c19d1e1121c73\n\n### For more information\n\nIf you have any questions or comments about this advisory, email us at [security@readthedocs.org](mailto:security@readthedocs.org) ([PGP](https://docs.readthedocs.io/page/security.html#pgp-key))",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "readthedocs-sphinx-search"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.3.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/readthedocs/readthedocs-sphinx-search/security/advisories/GHSA-xgfm-fjx6-62mj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/readthedocs/readthedocs-sphinx-search/commit/8c6f6d01e88e72ef32ed0c220b6c19d1e1121c73"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/readthedocs/readthedocs-sphinx-search"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-16T20:48:16Z",
    "nvd_published_at" : null
  }
}