Java code injections attempts

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Goal

Detect Java code injections attempts on web services executing OGNL expressions. Such security activity generally indicates that an attacker is trying to discover and exploit a potential OGNL code injection which can turn into a Remote Code Execution.

OGNL is an expression language that lets an application execute dynamic code in the application context. The expression starts as a string and can be made to execute. Upon execution, it is able to read or set access to Java objects available in its context, or call methods. OGNL injection is powerful and can achieve total takeover of an application.

Strategy

Monitor application security events to detect OGNL payloads (@appsec.rule_id:(dog-000-002 OR dog-000-003)) or more generic Java code injection payloads (@appsec.security_activity:attack_attempt.java_code_injection) on distributed traces where OGNL expressions are compiled (@_dd.appsec.enrichment.has_ognl:true).

Generate an Application Security Signal with MEDIUM severity if the payload is OGNL specific, LOW if generic.

Triage and response

  1. Consider blocking the attacking IPs temporarily to prevent them from reaching deeper parts of your production systems.
  2. Investigate the context in which OGNL queries are being executed. Check if any user parameter is used to craft the expression.