Skip to main content

Home OGNL injection

OGNL injection

(also OGNL injection attack)

OGNL injection definition

OGNL injection is a software application security vulnerability where a hacker uses the OGNL (Object-Graph Navigation Language) to manipulate and execute malicious code within an application. By doing so, cybercriminals can access and modify sensitive data or perform unauthorized commands. Developers can protect systems from OGNL injections with security measures like user input checks and regularly updating apps.

See also: code injection

How OGNL injection occurs

  • Input vulnerability: an application accepts user input or external data without checking if it's safe to use. This input can come in forms, search boxes, or user-generated content.
  • OGNL expression injection: an attacker sneaks in OGNL expressions within these input fields.
  • The application doesn't properly check the input: it mistakenly treats the injected input as valid OGNL expressions, even though they may contain harmful code.
  • Once the malicious OGNL expressions are executed, the attacker can do things like changing database queries, accessing unauthorized information, or running dangerous commands.
  • The impact of OGNL injection depends on the specific vulnerability and the skills of the attacker.

How to prevent OGNL injections

  • Perform thorough user input checks for unexpected or malicious characters.
  • Set up the app to only have the necessary permissions, so even if an OGNL attack happens, it won't cause too much damage.
  • Keep everything up to date in the app, like the tools it uses and the extra parts it relies on, to protect against known problems, including OGNL attacks.