Skip to content

[Java] Query for detecting Jakarta Expression Language injections #324

@artem-smotrakov

Description

@artem-smotrakov

Query

github/codeql#5471

Report

Jakarta EE contains a specification for an expression language (EL) and API for interpreters. There are multiple implementations of the API, for example, JUEL, Apache Commons EL, Glassfish has its own implementation. The language allows invocation of methods available in the JVM. If an expression is built using attacker-controlled data, and then evaluated, it may allow the attacker to run arbitrary code in the worst case.

  • Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc).

I am planning to write a blog post about detecting such injections.

I wrote a blog post about detecting Jakarta EL injections with CodeQL.

Result(s)

Provide at least one useful result found by your query, on some revision of a real project.

  • RCE in OpenFaces: There are several classes for processing AJAX requests. The classes take incoming data from a request and put it directly to a EL expression without any validation. In the worst case, it may result to an RCE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    All For OneSubmissions to the All for One, One for All bounty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions