
Ansible playbooks to check and mitigate CVE-2026-31431 on Linux hosts, with scripts for local, remote, and containerized environments, including CI/CD integration.
Checks whether a Linux host is vulnerable to CVE-2026-31431 and applies mitigation.
check_cve_2026_31431.yml - Ansible playbook to verify and patchrevert_cve_2026_31431.yml - Ansible playbook to undo mitigationrun_check.sh - Script to run verification locally or remotelyrun_revert.sh - Script to undo changes locally or remotely./run_check.sh
# Select 'l' for local
Or directly:
ansible-playbook -i "localhost," -c local --ask-become-pass check_cve_2026_31431.yml -v
Undoes the mitigation applied by run_check.sh:
./run_revert.sh
# Select 'l' for local
Or directly:
ansible-playbook -i "localhost," -c local --ask-become-pass revert_cve_2026_31431.yml -v
The revert removes /etc/modprobe.d/disable-algif.conf and attempts to reload the algif_aead module.
ansible-playbook -i "192.168.1.100," -u ubuntu --ask-become-pass check_cve_2026_31431.yml -v
With multiple hosts (create hosts.ini):
[servers]
192.168.1.100
192.168.1.101
ansible-playbook -i hosts.ini --ask-become-pass check_cve_2026_31431.yml -v
./run_revert.sh
# Select 'l' for local
docker run -it --privileged ubuntu:22.04 /bin/bash
# Inside the container:
apt update && apt install -y ansible python3
# Copy the playbook to the container or use curl/wget
ansible-playbook -i "localhost," -c local check_cve_2026_31431.yml -v
Or by mounting the playbook from the host:
docker run -it --privileged -v $(pwd)/check_cve_2026_31431.yml:/check.yml ubuntu:22.04
# Inside: ansible-playbook -i "localhost," -c local /check.yml -v
GitHub Actions (.github/workflows/check-cve.yml):
name: Check CVE-2026-31431
on:
push:
branches: [ main ]
pull_request:
jobs:
check-vulnerability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build test image
run: docker build -t test-image .
- name: Check for CVE-2026-31431 in container
run: |
docker run --rm \
-v ${{ github.workspace }}/check_cve_2026_31431.yml:/check.yml \
test-image \
/bin/bash -c "apt update && apt install -y ansible python3 && \
echo 'no' | ansible-playbook -i 'localhost,' -c local /check.yml -v"
- name: Fail if vulnerable
run: |
# The playbook must return != 0 if vulnerable
# Or parse the output looking for "VULNERABLE"
GitLab CI (.gitlab-ci.yml):
stages:
- build
- security
build_image:
stage: build
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
check_cve:
stage: security
script:
- docker run --rm -v $(pwd)/check_cve_2026_31431.yml:/check.yml $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
/bin/bash -c "apt-get update && apt-get install -y ansible python3 &&
ansible-playbook -i 'localhost,' -c local /check.yml -v | grep -q 'SAFE' || exit 1"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Dockerfile with build-time verification:
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y ansible python3 wget
# Copy and run check during build
COPY check_cve_2026_31431.yml /tmp/
RUN echo "no" | ansible-playbook -i "localhost," -c local /tmp/check_cve_2026_31431.yml -v | \
grep -q "SAFE" || (echo "VULNERABLE - Fix before building" && exit 1)
# Rest of your image...
authencesn algorithm is accessible via AF_ALGalgif_aead module (creates /etc/modprobe.d/disable-algif.conf)/etc/modprobe.d/disable-algif.confalgif_aead moduleauthencesn algorithm is accessible via AF_ALGalgif_aead moduleStatus: SAFE - System is protected
© 2026 EximiaIT
Security Assessment Tool – CVE-2026-31431 (Copy Fail)
This project is intended for authorized security testing, auditing, and educational purposes only. Any use of this software without proper authorization is strictly prohibited.
EximiaIT assumes no liability for misuse or damages resulting from this tool.