CVE-2024-47879: OpenRefine's PreviewExpressionCommand, which is eval, lacks protection against cross-site request forgery (CSRF)

Published Oct 24, 2024
·
Updated

Summary

Lack of CSRF 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.

Details

The com.google.refine.commands.expr.PreviewExpressionCommand class contains the following comment: / The command uses POST but does not actually modify any state so it does not require CSRF. /

However, this appears to be false (or no longer true). The expression being previewed (executed) can be written in GREL, Python, or Clojure. Since there are no restrictions on what code can be executed, the expression can do anything the user running OpenRefine can do. For instance, the following expressions start a calculator:

clojure:(.exec (Runtime/getRuntime) "gnome-calculator")

jython:import os;os.system("gnome-calculator")

The lack of restrictions on expressions is arguably not a problem if the user is typing their own expressions into OpenRefine: they could have just as well typed them into Clojure or Python directly. However, since the preview-expression command does not check for a CSRF token, the expression can actually come from a HTML form submitted by a different origin, including arbitrary websites.

Issue #2164 suggested adding CSRF protection to all endpoints, but this endpoint was skipped (and the above comment added) in the associated PR #2182.

PoC

An example "malicious" page is at https://wandernauta.nl/or/ (of course, actual malicious pages would not wait for the victim to press the submit button).

The following curl command (substituting the project ID) also demonstrates the issue:

sh curl -d project=123456789 -d cellIndex=1 -d rowIndices='[0]' -d 'expression=clojure:(.exec (Runtime/getRuntime) "gnome-calculator")' http://localhost:3333/command/core/preview-expression/

Impact

CSRF into remote code execution, provided the attacker knows at least one project ID in the victim's workspace and can convince the victim to open a malicious webpage.

Other sources

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.

MITRE

Affected Software

3 affected componentsFixes available
maven/org.openrefine:main<3.8.3
3.8.3
debian/openrefine<=3.6.2-2+deb12u2
3.8.7-1
OpenRefine openrefine<3.8.3

Event History

Oct 24, 2024
Advisory Published
via GitHub·05:58 PM
CVE Published
via MITRE·08:17 PM
Data Sourced
via MITRE·08:17 PM
DescriptionSeverityWeakness
Feb 10, 2025
Data Sourced
via Ubuntu·07:15 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-47879?

CVE-2024-47879 has been classified with a medium severity due to the potential for remote code execution via arbitrary expressions.

2

How do I fix CVE-2024-47879?

To fix CVE-2024-47879, it is recommended to upgrade OpenRefine to version 3.8.3 or later, which includes CSRF protections.

3

What types of code can be executed through CVE-2024-47879?

CVE-2024-47879 allows for the execution of arbitrary Clojure or Python code through an attacker-controlled expression.

4

Who is affected by CVE-2024-47879?

CVE-2024-47879 affects users of OpenRefine versions prior to 3.8.3.

5

What is the attack vector for CVE-2024-47879?

The attack vector for CVE-2024-47879 involves visiting a malicious website that triggers the vulnerable 'preview-expression' command.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203