Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-45187

CVE-2024-45187: Mage AI Privilege Escalation RCE Flaw

CVE-2024-45187 is a privilege escalation RCE vulnerability in Mage AI where deleted guest accounts retain elevated privileges, enabling remote code execution. This article covers technical details, impact, and mitigations.

Published:

CVE-2024-45187 Overview

CVE-2024-45187 affects the Mage AI framework, an open-source tool for building and orchestrating data pipelines. Guest users whose accounts are deleted retain their active sessions and receive elevated privileges instead of being logged out. These stale sessions grant access to the Mage AI terminal server, enabling remote code execution on the host. The flaw combines a session invalidation failure [CWE-613] with incorrect privilege assignment [CWE-266]. An attacker with a previously issued guest session can execute arbitrary commands after their account has been removed.

Critical Impact

Deleted guest accounts keep working sessions with elevated privileges, allowing arbitrary command execution through the Mage AI terminal server.

Affected Products

  • Mage AI (mage-ai) Python framework
  • Deployments exposing the Mage AI terminal server to authenticated users
  • Multi-tenant Mage AI instances that provision and delete guest accounts

Discovery Timeline

  • 2024-08-23 - CVE-2024-45187 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-45187

Vulnerability Analysis

Mage AI issues session tokens to authenticated users, including accounts with the guest role. Deleting a guest account removes the account record but does not invalidate the associated session token. The session remains valid on the server side and continues to authorize requests.

The defect compounds because the session handler resolves the deleted account to a privilege state higher than the original guest role. Requests carrying the stale token are treated as authorized to reach administrative surfaces, including the terminal server endpoint used for running shell commands inside the Mage AI environment.

An attacker exploiting this flaw executes arbitrary commands with the privileges of the Mage AI process. That process typically has access to pipeline code, data source credentials, and environment secrets. The vulnerability is network reachable and requires only a previously issued guest session.

Root Cause

Two weaknesses combine to produce the impact. First, insufficient session expiration [CWE-613] leaves tokens valid after their backing account is deleted. Second, incorrect privilege assignment [CWE-266] promotes the orphaned session rather than rejecting it. Neither the authentication layer nor the authorization layer treats a deleted principal as unauthenticated.

Attack Vector

Exploitation requires an attacker to hold a guest session token issued before their account was deleted. The attacker sends authenticated requests to the terminal server route exposed by Mage AI. The server accepts the stale token, applies elevated privileges, and executes submitted commands on the host. See the JFrog Vulnerability Analysis for the request flow and endpoint details.

Detection Methods for CVE-2024-45187

Indicators of Compromise

  • Authenticated requests to Mage AI terminal server endpoints originating from user identifiers that no longer exist in the account database.
  • Terminal command executions logged against session tokens whose owning accounts were previously deleted.
  • Outbound connections or filesystem writes from the Mage AI process that do not correlate with scheduled pipeline runs.

Detection Strategies

  • Correlate Mage AI access logs with account lifecycle events to flag sessions active after the associated account was deleted.
  • Alert on any invocation of the terminal server route by non-administrator roles, including guest sessions.
  • Baseline expected shell activity from the Mage AI service account and surface deviations such as reconnaissance commands or credential access.

Monitoring Recommendations

  • Enable verbose authentication logging in Mage AI and forward events to a centralized log platform.
  • Monitor process execution on Mage AI hosts for child processes spawned from the terminal server.
  • Track session token issuance and revocation events, and audit tokens that survive account deletion.

How to Mitigate CVE-2024-45187

Immediate Actions Required

  • Upgrade Mage AI to a version that invalidates sessions on account deletion and corrects the privilege mapping for guest roles.
  • Revoke all active sessions after upgrading and require users to reauthenticate.
  • Audit the account database for deletion events and confirm that no sessions from those accounts remain valid.
  • Restrict network access to the Mage AI terminal server so it is not reachable from untrusted networks.

Patch Information

Refer to the upstream Mage AI project for the fixed release addressing CVE-2024-45187. Technical context and vulnerable code paths are documented in the JFrog Vulnerability Analysis. Apply the fix to every Mage AI instance and rotate credentials referenced by pipelines after patching.

Workarounds

  • Disable the terminal server feature in Mage AI configuration if it is not required for operations.
  • Place Mage AI behind an authenticating reverse proxy that terminates sessions independently and enforces role checks.
  • Avoid provisioning guest accounts on production instances until the patch is applied.
  • Rotate all issued session tokens after any account deletion to force reauthentication.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.