REDHAT-BUG-2530995: Medium severity ansible-community.general/plugins/cache/memcached.py vulnerability

Published Sep 9, 2026
·
Updated

plugins/cache/memcached.py documents "JSON formatted" records (line 13) but imports neither json nor pickle and does no explicit (de)serialization. set() passes the Ansible facts dict directly to python-memcached with mincompresslen=1 (lines 214-217); get() returns the client result unchanged (lines 201-212). python-memcached auto-pickles non-str/int values (FLAGPICKLE) and, with mincompresslen set, compresses them (FLAGCOMPRESSED) -> stored flags 9, and calls pickle.loads() on read. The sibling plugins/cache/redis.py uses explicit AnsibleJSONEncoder/Decoder (lines 189, 194). memcached has no authentication and the key is "ansiblefacts<host>" (default prefix, lines 31/193-194), so an attacker with network reach to the memcached instance can poison a fact-cache entry that the controller unpickles on the next read, yielding code execution as the ansible user. Upstream: https://github.com/ansible-collections/community.general plugins/cache/memcached.py — UNFIXED (no PR; no public CVE) Affected file: plugins/cache/memcached.py (:13 docstring, :201-217 get/set)

Affected Software

1 affected component
ansible-community.general/plugins/cache/memcached.py

Event History

Sep 9, 2026
Data Sourced
via Red Hat·02:47 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

An attacker needs network reachability to the memcached instance used by the Ansible fact cache. Because the memcached service has no authentication, that access is sufficient to modify a targeted cache entry.

2

What is required for code execution to occur?

The attacker must poison the cache entry for a host, using the default-style key ansible_facts<host>. Code execution occurs when the Ansible controller next reads that entry and deserializes it with pickle as the Ansible user.

3

How can I identify potentially poisoned entries?

Inspect memcached entries associated with ansible_facts<host>. Values stored through this plugin may use flags 9, representing pickle serialization combined with compression; unexpected values or entries for hosts should be treated as suspicious.

4

What can be done if a fix is not available?

Prevent untrusted systems from reaching the memcached instance, since network access enables cache poisoning. Avoid using the affected memcached cache plugin where that access cannot be reliably restricted; the sibling Redis cache plugin uses explicit Ansible JSON encoding and decoding instead of relying on pickle.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203