DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Why Is Apache Struts So Vulnerable?

Learn more about this Java-based web framework and why it is prone to so many vulnerabilities.

Jocelyn Chan user avatar by
Jocelyn Chan
·
May. 16, 19 · Opinion
Like (1)
Save
Tweet
Share
4.27K Views

Join the DZone community and get the full member experience.

Join For Free

Apache Struts is a well-known development framework for Java-based web applications and is mostly used in enterprise environments. If you search for Apache Struts CVEs on MITRE, you currently get 77 results, and most of the critical ones are due to OGNL expression injection, which is very similar to SSTI (Server Side Template Injection) attacks.

In this article, we will briefly go through the security history of Apache Struts, common Apache Struts security issues, and the impact of these vulnerabilities.

Recent History of Apache Struts

Apache Struts has a rough security history with many critical vulnerabilities, and because of these, the infamous Equifax hack was made possible since CVE-2017-5638 was mainly used to get a hold of millions of records of creditholders’ data. Apache Struts has not only suffered from OGNL expression injection vulnerabilities but also deserialization.

Deserialization Vulnerabilities

Deserialization is the opposite of serialization, which is converting data structured from one format and rebuilding it into an object (read more here). JSON and XML are examples of data formats for serializing. Java has a long history of deserialization bugs, and Oracle has even said that they have plans to remove it due to the security implications.

OGNL Expression Injection

Object-Graph Navigation Language (OGNL) is an expression language for handling Java objects. When an OGNL expression injection vulnerability is present, it is possible for the attacker to inject OGNL expressions. These expressions can execute arbitrary Java code.

Searching for this vulnerability in a black box environment is easy and can have the same approach as searching for SSTI vulnerabilities. We can inject OGNL expressions in all user supplied data fields and see if we get any response back indicating that the expression has been handled and executed on the server.

If you're looking for a proof of concept, check out the video below:


An example of an expression to use could be as simple as: foobar%{191*7} where %{191*7}is the expression. The output from this would be 1337. These expressions can, of course, be something other than just mathematical, but this is a way to easily detect the vulnerability.

Apache Struts

Published at DZone with permission of Jocelyn Chan. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Public Key and Private Key Pairs: Know the Technical Difference
  • How To Best Use Java Records as DTOs in Spring Boot 3
  • AWS CodeCommit and GitKraken Basics: Essential Skills for Every Developer
  • Test Execution Tutorial: A Comprehensive Guide With Examples and Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: