CVE-2024-9902: Ansible core Ansible-core Incorrect Authorization Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-32p4-gm2c-wmch
CVSS 6.3
CWE-863
Published
Advisory Summary

CVE-2024-9902 is a MODERATE (CVSS 6.3) ansible-core incorrect authorization vulnerability vulnerability (CWE-863: Incorrect Authorization) affecting Ansible core libraries in the PyPI ecosystem. The issue involves ansible-core incorrect authorization vulnerability. Remediation is available by upgrading affected packages to version 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2.

CVE-2024-9902 at a Glance

CVE Identifier CVE-2024-9902
GHSA Identifier GHSA-32p4-gm2c-wmch
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-863: Incorrect Authorization
Affected Product Ansible core
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2024-9902

To remediate this vulnerability, upgrade all affected Ansible core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ansible-core fixed: 2.14.18rc1
pip install ansible-core>=2.14.18rc1
ansible-core fixed: 2.15.13rc1
pip install ansible-core>=2.15.13rc1
ansible-core fixed: 2.16.13rc1
pip install ansible-core>=2.16.13rc1
ansible-core fixed: 2.17.6rc1
pip install ansible-core>=2.17.6rc1
ansible-core fixed: 2.18.0rc2
pip install ansible-core>=2.18.0rc2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ansible-core

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-9902, inspect your installed packages using pip:

pip show ansible-core

Analyze the terminal output to locate any version of Ansible core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.14.18rc1), your application is affected.

Note: The pip show ansible-core command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Ansible core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A flaw was found in Ansible. The ansible-core `user` module can allow an unprivileged user to silently create or replace the contents of any file on any system path and take ownership of it when a privileged user executes the `user` module against the unprivileged user's home directory. If the unprivileged user has traversal permissions on the directory containing the exploited target file, they retain full control over the contents of the file as its owner.

CVE-2024-9902 Affected Ansible core Versions

5 component(s)
Fixed Versions:
2.14.18rc12.15.13rc12.16.13rc12.17.6rc12.18.0rc2
Product / Package Ecosystem Affected Versions Fixed Version
ansible-core
PyPI
< 2.14.18rc1
2.14.18rc1
ansible-core
PyPI
≥ 2.15.0b1
< 2.15.13rc1
2.15.13rc1
ansible-core
PyPI
≥ 2.16.0b1
< 2.16.13rc1
2.16.13rc1
ansible-core
PyPI
≥ 2.17.0b1
< 2.17.6rc1
2.17.6rc1
ansible-core
PyPI
≥ 2.18.0b1
< 2.18.0rc2
2.18.0rc2

References

Frequently Asked Questions

What is CVE-2024-9902?
CVE-2024-9902 is a security vulnerability in Ansible core involving ansible-core Incorrect Authorization vulnerability under CWE-863: Incorrect Authorization.
Which Ansible core versions are affected?
Affected versions include releases prior to 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2 across affected packages: ansible-core.
What version fixes CVE-2024-9902?
Upgrading to 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ansible-core affected?
Yes, ansible-core is affected in releases prior to 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2. Upgrade your dependency to 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2 or later.
What is the CVSS score of CVE-2024-9902?
CVE-2024-9902 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2024-9902?
CVE-2024-9902 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check PyPI dependencies for CVE-2024-9902?
Run the dependency tree command: 'pip show ansible-core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-32p4-gm2c-wmch",
  "modified" : "2025-11-04T16:53:27Z",
  "published" : "2024-11-06T12:31:32Z",
  "aliases" : [ "CVE-2024-9902" ],
  "summary" : "ansible-core Incorrect Authorization vulnerability",
  "details" : "A flaw was found in Ansible. The ansible-core `user` module can allow an unprivileged user to silently create or replace the contents of any file on any system path and take ownership of it when a privileged user executes the `user` module against the unprivileged user's home directory. If the unprivileged user has traversal permissions on the directory containing the exploited target file, they retain full control over the contents of the file as its owner.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.14.18rc1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.15.0b1"
      }, {
        "fixed" : "2.15.13rc1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.16.0b1"
      }, {
        "fixed" : "2.16.13rc1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.17.0b1"
      }, {
        "fixed" : "2.17.6rc1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.18.0b1"
      }, {
        "fixed" : "2.18.0rc2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-9902"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/03794735d370db98a5ec2ad514fab2b0dd22d6be"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/03daf774d0d80fb7235910ed1c2b4fbcaebdfe65"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/3b6de811abea0a811e03e3029222a7e459922892"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/9d7312f695639e804d2caeb1d0f51c716a9ac7dd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/f7be90626da3035c697623dcf9c90b7a0bc91c92"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:10762"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:8969"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:9894"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2025:1861"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2024-9902"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2318271"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansible/ansible"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/11/msg00021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-06T15:37:19Z",
    "nvd_published_at" : "2024-11-06T10:15:06Z"
  }
}