CVE-2024-47882: Openrefine Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-j8hp-f2mj-586g
CVSS 5.9
CWE-81 CWE-79
Published
Advisory Summary

CVE-2024-47882 is a MODERATE (CVSS 5.9) cross-site scripting vulnerability (CWE-81: Improper Neutralization of Script in an Error Message Web Page) affecting Openrefine libraries in the Maven ecosystem. The issue involves openrefine's error page lacks escaping, leading to potential cross-site scripting on import of malicious project. Remediation is available by upgrading affected packages to version 3.8.3.

CVE-2024-47882 at a Glance

CVE Identifier CVE-2024-47882
GHSA Identifier GHSA-j8hp-f2mj-586g
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-81: Improper Neutralization of Script in an Error Message Web Page
Affected Product Openrefine
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-47882

To remediate this vulnerability, upgrade all affected Openrefine dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.openrefine:openrefine fixed: 3.8.3
<dependency>
    <groupId>org.openrefine</groupId>
    <artifactId>openrefine</artifactId>
    <version>3.8.3</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.openrefine

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-47882, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.openrefine

Analyze the terminal output to locate any version of Openrefine in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.openrefine command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-81: Improper Neutralization of Script in an Error Message Web Page, where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page. In Openrefine, 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

### Summary The built-in "Something went wrong!" error page includes the exception message and exception traceback without escaping HTML tags, enabling injection into the page if an attacker can reliably produce an error with an attacker-influenced message. It appears that the only way to reach this code in OpenRefine itself is for an attacker to somehow convince a victim to import a malicious file, as in GHSA-m88m-crr9-jvqq, which may be difficult. However, out-of-tree extensions may add their own calls to `respondWithErrorPage`. ### Details The `Command.respondWithErrorPage` (through `HttpUtilities.respondWithErrorPage`) function renders the Velocity template `error.vt`, which contains the `$message` and `$stack` variables, which are included in the response as-is: https://github.com/OpenRefine/OpenRefine/blob/master/main/webapp/modules/core/error.vt#L52-L53 However, the message can contain HTML tags, which would then be interpreted by the browser. A mitigation would be to escape both the message and stack trace, perhaps using Guava's HTML escaper. Flows that report errors as `application/json` responses are not interpreted by the browser and so not affected by this issue. ### PoC In OpenRefine, use the "Import project" feature to import the following URL (or upload it as a file): https://wandernauta.nl/oa/example.tar.gz A JavaScript alert appears. ### Impact Execution of arbitrary JavaScript in the victim's browser, provided the victim can be convinced to import a malicious project. The script can do anything the user can do.

CVE-2024-47882 Affected Openrefine Versions

1 component(s)
Fixed Versions:
3.8.3
Product / Package Ecosystem Affected Versions Fixed Version
org.openrefine:openrefine
Maven
< 3.8.3
3.8.3

References

Frequently Asked Questions

What is CVE-2024-47882?
CVE-2024-47882 is a security vulnerability in Openrefine involving OpenRefine's error page lacks escaping, leading to potential Cross-site Scripting on import of malicious project under CWE-81: Improper Neutralization of Script in an Error Message Web Page.
Which Openrefine versions are affected?
Affected versions include releases prior to 3.8.3 across affected packages: org.openrefine:openrefine.
What version fixes CVE-2024-47882?
Upgrading to 3.8.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openrefine affected?
Yes, org.openrefine:openrefine is affected in releases prior to 3.8.3. Upgrade your dependency to 3.8.3 or later.
What is the CVSS score of CVE-2024-47882?
CVE-2024-47882 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2024-47882?
CVE-2024-47882 is classified under CWE-81: Improper Neutralization of Script in an Error Message Web Page (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page.).
How can I check Maven dependencies for CVE-2024-47882?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.openrefine'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-j8hp-f2mj-586g",
  "modified" : "2024-10-24T21:46:03Z",
  "published" : "2024-10-24T18:13:04Z",
  "aliases" : [ "CVE-2024-47882" ],
  "summary" : "OpenRefine's error page lacks escaping, leading to potential Cross-site Scripting on import of malicious project",
  "details" : "### Summary\n\nThe built-in \"Something went wrong!\" error page includes the exception message and exception traceback without escaping HTML tags, enabling injection into the page if an attacker can reliably produce an error with an attacker-influenced message.\n\nIt appears that the only way to reach this code in OpenRefine itself is for an attacker to somehow convince a victim to import a malicious file, as in GHSA-m88m-crr9-jvqq, which may be difficult.  However, out-of-tree extensions may add their own calls to `respondWithErrorPage`.\n\n### Details\n\nThe `Command.respondWithErrorPage` (through `HttpUtilities.respondWithErrorPage`) function renders the Velocity template `error.vt`, which contains the `$message` and `$stack` variables, which are included in the response as-is:\n\nhttps://github.com/OpenRefine/OpenRefine/blob/master/main/webapp/modules/core/error.vt#L52-L53\n\nHowever, the message can contain HTML tags, which would then be interpreted by the browser. A mitigation would be to escape both the message and stack trace, perhaps using Guava's HTML escaper.\n\nFlows that report errors as `application/json` responses are not interpreted by the browser and so not affected by this issue.\n\n### PoC\n\nIn OpenRefine, use the \"Import project\" feature to import the following URL (or upload it as a file): https://wandernauta.nl/oa/example.tar.gz\n\nA JavaScript alert appears.\n\n### Impact\n\nExecution of arbitrary JavaScript in the victim's browser, provided the victim can be convinced to import a malicious project. The script can do anything the user can do.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.openrefine:openrefine"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/OpenRefine/OpenRefine/security/advisories/GHSA-j8hp-f2mj-586g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47882"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenRefine/OpenRefine/commit/85594e75e7b36025f7b6a67dcd3ec253c5dff8c2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OpenRefine/OpenRefine"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenRefine/OpenRefine/blob/master/main/webapp/modules/core/error.vt#L52-L53"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-81" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-24T18:13:04Z",
    "nvd_published_at" : "2024-10-24T21:15:13Z"
  }
}