GHSA-Q6J3-C4WC-63VW
Vulnerability from github – Published: 2020-08-11 14:54 – Updated: 2021-09-23 18:50Impact
The HTML form for a read-only canned query includes the hidden CSRF token field added in #798 for writable canned queries (#698).
This 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:
https://latest.datasette.io/fixtures/neighborhood_search?text=down&csrftoken=CSRFTOKEN-HERE
This 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.
Patches
A fix for this issue has been released in Datasette 0.46.
Workarounds
You can fix this issue in a Datasette instance without upgrading by copying the 0.46 query.html template into a custom templates/ directory and running Datasette with the --template-dir=templates/ option.
References
Issue 918 discusses this in details: https://github.com/simonw/datasette/issues/918
For more information
Contact swillison at gmail with any questions.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "datasette"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.46"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-200"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-10T22:36:11Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"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\u0026csrftoken=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.",
"id": "GHSA-q6j3-c4wc-63vw",
"modified": "2021-09-23T18:50:16Z",
"published": "2020-08-11T14:54:40Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "CSRF tokens leaked in URL by canned query form"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.