CVE-2026-87874 is a high severity unsafe deserialization flaw in Ansible community.general, scored 8.1. The record does not name a fixed version. Check your installed version against the affected list below, then patch or restrict access until you can. The record does not flag it as exploited.
What's affected
- The memcached cache plugin of the community.general Ansible collection.
- The record does not list affected or fixed collection versions.
Severity in the record: High (8.1), vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Weakness: CWE-502.
Fix: The record does not name a fixed version. Check the Red Hat CVE page for the fix status of your Ansible packages.
How to check if you're exposed
- List installed collections:
ansible-galaxy collection list community.general. - Search your ansible.cfg and environment for the memcached fact cache setting:
grep -rn fact_caching ansible.cfg. - Check whether the memcached instance is reachable beyond the controller.
Run these on every host, image and build that could carry the component. Dependency files in repositories and base images in registries are easy to miss.
What to do now
- Confirm the version of every affected system using the checks above.
- Read the vendor advisory linked in Sources and note the fixed version for your release line.
- Schedule the update, starting with systems that face untrusted networks or hold the most sensitive data.
- In the meantime: if you use the memcached fact cache, switch to a different cache plugin such as jsonfile until a fix is confirmed, and bind memcached to localhost or a private network.
- Record the change, then recheck the version to confirm it took effect.
Why it matters
The plugin documents JSON storage but does no serialization of its own. It relies on python-memcached, which pickles values on write and unpickles them on read. Unpickling attacker-controlled data can run code, which is CWE-502. Memcached has no authentication and cache keys are predictable, so anyone who can reach the instance can poison the fact cache. The poisoned entry executes on the Ansible controller the next time it is read. The record rates complexity high because the attacker must reach the cache.
The record's KEV flag is false, so this post makes no claim that the flaw is exploited in the wild. That can change, so recheck the CISA catalog from time to time.
Libraries like this often arrive as transitive dependencies, so the version in your lockfile may not be one you chose. Safeguard's free in-browser dependency scan can show whether the package is in a project, and reachability analysis helps separate code paths that call the weak function from those that never do.
Try it yourself
Click through it at your own pace, or open it full screen.
The vector string in the record is a compact summary of how the flaw is reached and what it costs. AV is the attack vector (network, adjacent or local), PR is the privilege the attacker needs, and the C, I and A letters give the impact on confidentiality, integrity and availability. Read it against your own network layout rather than relying on the score alone.
After you patch
Patching is not the end of the job. Recheck the version on each system, because an upgrade that failed or rolled back looks the same as a success until someone looks. Keep the advisory link with your change record so the next reviewer can see why the update happened.
If you cannot patch soon, write down the reason, the compensating control you chose and a date to revisit. Exceptions without a date tend to become permanent.
Quick check
Why is a cache a code execution risk?
Because the plugin deserializes pickled values from memcached, and memcached does not authenticate writers.
Sources
-
Red Hat: CVE-2026-87874
-
Safeguard Gold: CVE-2026-87874
Last reviewed: 18 October 2026.