CVE-2024-47879·Python vulnerability
OpenRefine is a free, open source tool for working with messy data. Prior to version 3.8.3, lack of cross-site request forgery protection on the `preview-expression` command means that visiting a malicious website could cause an attacker-controlled expression to be executed. The expression can contain arbitrary Clojure or Python code. The attacker must know a valid project ID of a project that contains at least one row, and the attacker must convince the victim to open a malicious webpage. Version 3.8.3 fixes the issue.
- Severity
- high
- Software
- Python
- Fixed in
- 3.8.3
- Published
- 2024-10-24
Affected versions
Until: 3.8.3
Fixed in: 3.8.3
How to fix this CVE
OpenRefine versions prior to 3.8.3 contain a CSRF vulnerability in the preview-expression endpoint that allows remote code execution through arbitrary Clojure or Python expressions. Immediately upgrade OpenRefine to version 3.8.3 or later to apply CSRF token validation and prevent unauthorized expression execution. This requires updating the OpenRefine application itself, not the Python package, as the vulnerability exists in the OpenRefine tool rather than the Python runtime.
Download and install OpenRefine 3.8.3 or later from https://github.com/OpenRefine/OpenRefine/releases. If using EPEL repository: sudo dnf install openrefineDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST /command/core/preview-expression with Content-Type: application/x-www-form-urlencoded containing 'expression=' parameter with Clojure/Python code patterns such as 'clojure.java.shell/sh' or 'import os; os.system'WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block POST requests to /command/core/preview-expression endpoints that lack valid CSRF tokens. Implement token validation on the preview-expression endpoint by checking for the 'X-CSRF-Token' header. Rate-limit expression evaluation requests from individual IPs to prevent batch exploitation attempts.How to check if you are affected
- Step 1: Check installed OpenRefine version by navigating to the About menu in the OpenRefine web interface or running: grep -r '"version"' /path/to/openrefine/server/index.html
- Step 2: Verify if OpenRefine is running and accessible on the network by checking open ports: netstat -tlnp | grep -i java or ss -tlnp | grep -i java
- Step 3: Search application logs for suspicious preview-expression requests: grep -i 'preview-expression' /var/log/openrefine/*.log /path/to/openrefine/logs/*.log
- Step 4: Confirm the patched version is running by checking the OpenRefine release notes match version 3.8.3 or later: curl -s http://localhost:3333/about.html | grep -i version
FAQ
What is CVE-2024-47879?
CVE-2024-47879 is a cross-site request forgery (CSRF) vulnerability in OpenRefine's preview-expression endpoint that allows attackers to inject and execute arbitrary Clojure or Python code on vulnerable servers. An attacker can craft a malicious webpage that, when visited by an OpenRefine user, silently executes attacker-controlled expressions within the context of the victim's project.
Is CVE-2024-47879 being actively exploited?
No, CVE-2024-47879 is not currently listed in the CISA Known Exploited Vulnerabilities catalog, and no public exploit code has been released. However, the attack requires minimal technical complexity and should be patched immediately given the high severity.
What versions of OpenRefine are affected by CVE-2024-47879?
All OpenRefine versions prior to 3.8.3 are vulnerable. The exact earliest affected version is unknown, but the issue has been present in versions going back several releases. Version 3.8.3 and all subsequent releases contain the fix.
How do I check if my server is vulnerable to CVE-2024-47879?
Run: curl -s http://localhost:3333/ | grep -o 'OpenRefine [0-9.]*' or check the About page in the OpenRefine UI. If the version is below 3.8.3, the server is vulnerable.
Does Defensia detect CVE-2024-47879?
Yes — Defensia's CVE advisory scanner monitors OpenRefine deployments and compares installed versions against known vulnerabilities including CVE-2024-47879. If an affected version is detected, the vulnerability will appear in your dashboard with step-by-step remediation guidance.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-47879. Free for 1 server.
Get started free