GHSA-q6j3-c4wc-63vw: Datasette CSRF Tokens Leaked Vulnerability
MODERATEGHSA-q6j3-c4wc-63vw is a MODERATE (CVSS 4.3) csrf tokens leaked vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Datasette libraries in the PyPI ecosystem. The issue involves csrf tokens leaked in url by canned query form. Remediation is available by upgrading affected packages to version 0.46.
GHSA-q6j3-c4wc-63vw at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N).
How to Fix GHSA-q6j3-c4wc-63vw
To remediate this vulnerability, upgrade all affected Datasette 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 datasette>=0.46
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show datasette
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-q6j3-c4wc-63vw, inspect your installed packages using pip:
pip show datasette
Analyze the terminal output to locate any version of Datasette in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.46), your application is affected.
Note: The pip show datasette command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Datasette, 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
GHSA-q6j3-c4wc-63vw Affected Datasette Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
datasette
|
PyPI |
< 0.46
|
0.46
|
References
Frequently Asked Questions
What is GHSA-q6j3-c4wc-63vw?
Which Datasette versions are affected?
What version fixes GHSA-q6j3-c4wc-63vw?
Is datasette affected?
What is the CVSS score of GHSA-q6j3-c4wc-63vw?
What CWE is associated with GHSA-q6j3-c4wc-63vw?
How can I check PyPI dependencies for GHSA-q6j3-c4wc-63vw?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q6j3-c4wc-63vw",
"modified" : "2021-09-23T18:50:16Z",
"published" : "2020-08-11T14:54:40Z",
"aliases" : [ ],
"summary" : "CSRF tokens leaked in URL by canned query form",
"details" : "### Impact\n\nThe HTML form for a read-only canned query includes the hidden CSRF token field added in #798 for writable canned queries (#698).\n\nThis means that submitting those read-only forms exposes the CSRF token in the URL - for example on https://latest.datasette.io/fixtures/neighborhood_search submitting the form took me to:\n\nhttps://latest.datasette.io/fixtures/neighborhood_search?text=down&csrftoken=CSRFTOKEN-HERE\n\nThis token could potentially leak to an attacker if the resulting page has a link to an external site on it and the user clicks the link, since the token would be exposed in the referral logs.\n\n### Patches\n\nA fix for this issue has been released in Datasette 0.46.\n\n### Workarounds\n\nYou can fix this issue in a Datasette instance without upgrading by copying the [0.46 query.html template](https://raw.githubusercontent.com/simonw/datasette/0.46/datasette/templates/query.html) into a custom `templates/` directory and running Datasette with the `--template-dir=templates/` option.\n\n### References\n\nIssue 918 discusses this in details: https://github.com/simonw/datasette/issues/918\n\n### For more information\n\nContact swillison at gmail with any questions.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "datasette"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.46"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/simonw/datasette/security/advisories/GHSA-q6j3-c4wc-63vw"
}, {
"type" : "WEB",
"url" : "https://github.com/simonw/datasette/issues/918"
}, {
"type" : "WEB",
"url" : "https://github.com/simonw/datasette/commit/7f10f0f7664d474c1be82bf668829e3b736a3d2b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/simonw/datasette"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-PYTHON-DATASETTE-598229"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-10T22:36:11Z",
"nvd_published_at" : null
}
}