Skip to content

Java: Query for detecting unsafe deserialization with Spring exporters #289

Closed
@artem-smotrakov

Description

@artem-smotrakov

CVE ID(s)

Not yet.

Report

Spring Framework provides an abstract base class RemoteInvocationSerializingExporter for defining remote service exporters. A Spring exporter, which is based on this class, deserializes incoming data using ObjectInputStream. Deserializing untrusted data (CWE-502) is easily exploitable and in many cases allows an attacker to execute arbitrary code. Spring Framework also provides two classes that extend RemoteInvocationSerializingExporter:

  • HttpInvokerServiceExporter
  • SimpleHttpInvokerServiceExporter

CVE-2016-1000027 has been assigned to this issue in Spring Framework. There is no fix for that.

I'd like to propose a new experimental query that looks for unsafe deserialization with Spring exporters:

github/codeql#5260

Many projects have received alerts about CVE-2016-1000027 from security scanners. Since Spring Framework didn't address the issue, they can't just update Spring Framework. Instead, they have to understand the issue and check their code. This query can make their life easier and help them check the code. Moreover, the query can detect unsafe exporters even without scanners that look for known vulnerabilities.

  • Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc). We would love to have you spread the word about the good work you are doing

I wrote a blog post about detecting unsafe deserialization with Spring exporters with CodeQL.

Result(s)

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