7.1high
check-jsonschema default caching for remote schemas allows for cache confusion
- Severity
- 7.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-q6mv-284r-mp36PYSEC-2026-1245
Description
check-jsonschema is a CLI and set of pre-commit hooks for jsonschema validation. The default cache strategy uses the basename of a remote schema as the name of the file in the cache, e.g. `https://example.org/schema.json` will be stored as `schema.json`. This naming allows for conflicts. If an attacker can get a user to run `check-jsonschema` against a malicious schema URL, e.g., `https://example.evil.org/schema.json`, they can insert their own schema into the cache and it will be picked up and used instead of the appropriate schema. Such a cache confusion attack could be used to allow data to pass validation which should have been rejected. This issue has been patched in version 0.30.0. All users are advised to upgrade. A few workarounds exist: 1. Users can use `--no-cache` to disable caching. 2. Users can use `--cache-filename` to select filenames for use in the cache, or to ensure that other usages do not overwrite the cached schema. (Note: this flag is being deprecated as part of the remediation effort.) 3. Users can explicitly download the schema before use as a local file, as in `curl -LOs https://example.org/schema.json; check-jsonschema --schemafile ./schema.json`
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| python-jsonschema check-jsonschema | < 0.30.0 | CVE List |
| check-jsonschema (PyPI) | before 0.30.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N |
| GitHub | 7.1medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N |
| PyPA Advisory Database | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N |
| PyPA Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
check-jsonschema is a CLI and set of pre-commit hooks for jsonschema validation. The default cache strategy uses the basename of a remote schema as the name of the file in the cache, e.g. `https://example.org/schema.json` will be stored as `schema.json`. This naming allows for conflicts. If an attacker can get a user to run `check-jsonschema` against a malicious schema URL, e.g., `https://example.evil.org/schema.json`, they can insert their own schema into the cache and it will be picked up and used instead of the appropriate schema. Such a cache confusion attack could be used to allow data to pass validation which should have been rejected. This issue has been patched in version 0.30.0. All users are advised to upgrade. A few workarounds exist: 1. Users can use `--no-cache` to disable caching. 2. Users can use `--cache-filename` to select filenames for use in the cache, or to ensure that other usages do not overwrite the cached schema. (Note: this flag is being deprecated as part of the remediation effort.) 3. Users can explicitly download the schema before use as a local file, as in `curl -LOs https://example.org/schema.json; check-jsonschema --schemafile ./schema.json`
GitHub Advisory Database
Impact
The default cache strategy uses the basename of a remote schema as the name of the file in the cache, e.g. https://example.org/schema.json will be stored as schema.json. This naming allows for conflicts. If an attacker can get a user to run check-jsonschema against a malicious schema URL, e.g., https://example.evil.org/schema.json, they can insert their own schema into the cache and it will be picked up and used instead of the appropriate schema.
Such a cache confusion attack could be used to allow data to pass validation which should have been rejected.
Patches
A patch is in progress but has not yet been released.
Workarounds
- Users can use
--no-cacheto disable caching. - Users can use
--cache-filenameto select filenames for use in the cache, or to ensure that other usages do not overwrite the cached schema. (Note: this flag is being deprecated as part of the remediation effort.) - Users can explicitly download the schema before use as a local file, as in
curl -LOs https://example.org/schema.json; check-jsonschema --schemafile ./schema.json
NVD (es)
check-jsonschema es una CLI y un conjunto de ganchos de pre-confirmación para la validación de jsonschema. La estrategia de caché predeterminada utiliza el nombre base de un esquema remoto como el nombre del archivo en la caché, p. ej., `https://example.org/schema.json` se almacenará como `schema.json`. Este nombre permite conflictos. Si un atacante puede lograr que un usuario ejecute `check-jsonschema` contra una URL de esquema malintencionada, p. ej., `https://example.evil.org/schema.json`, puede insertar su propio esquema en la caché y se seleccionará y usará en lugar del esquema apropiado. Un ataque de confusión de caché de este tipo podría usarse para permitir que los datos pasen la validación que deberían haber sido rechazados. Este problema se ha corregido en la versión 0.30.0. Se recomienda a todos los usuarios que actualicen. Existen algunos workaround: 1. Los usuarios pueden usar `--no-cache` para deshabilitar el almacenamiento en caché. 2. Los usuarios pueden usar `--cache-filename` para seleccionar nombres de archivos para usar en la memoria caché o para garantizar que otros usos no sobrescriban el esquema almacenado en caché. (Nota: esta opción se está descontinuando como parte del esfuerzo de remediación). 3. Los usuarios pueden descargar explícitamente el esquema antes de usarlo como un archivo local, como en `curl -LOs https://example.org/schema.json; check-jsonschema --schemafile ./schema.json`
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-53848 changed 2024-12-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-q6mv-284r-mp36 changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2024-53848 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1245 changed 2026-07-07 | CC-BY-4.0 |