libinput/src
Peter Hutterer fc2262e1c1 util: sanitize control characters in str_sanitize()
str_sanitize() only escaped '%' characters for format string safety.
Device names from uinput devices can contain arbitrary bytes including
ANSI escape sequences (ESC, 0x1b) and other control characters. When
these strings are included in log messages and printed to a terminal,
the escape sequences are interpreted by the terminal emulator. This
could allow an attacker to manipulate terminal output (change colors,
set window title, clear screen) when an administrator views libinput
logs.

Replace all control characters (0x00-0x1f and 0x7f) with '?' in
addition to the existing '%' escaping. This prevents terminal escape
sequence injection through device names in log output.

Assisted-by: Claude:claude-opus-4-6
(cherry picked from commit 71a2c5cae2)

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1489>
2026-06-04 10:32:28 +10:00
..
builddir.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-fallback.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
evdev-fallback.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-frame.h evdev: remove duplicate sizeof 2025-08-01 22:34:07 +00:00
evdev-middle-button.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-mt-touchpad-buttons.c touchpad: fix a clang-tidy warning 2025-08-06 07:34:54 +00:00
evdev-mt-touchpad-edge-scroll.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-mt-touchpad-gestures.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-mt-touchpad-tap.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-mt-touchpad-thumb.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-mt-touchpad.c touchpad: use INPUT_PROP_PRESSUREPAD as signal it's a pressurepad 2025-12-08 10:27:41 +10:00
evdev-mt-touchpad.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-plugin.c plugin/evdev: drop the duplicate event frame printing 2025-07-21 11:53:57 +10:00
evdev-plugin.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-tablet-pad-leds.c meson.build: change from config.set10() and #if to config.set() and #ifdef 2025-07-28 12:04:09 +10:00
evdev-tablet-pad.c pad: add some extra asserts to shut up clang-tidy 2025-08-11 15:27:31 +10:00
evdev-tablet-pad.h pad: don't assert when unable to find the mode group, just discard 2025-08-04 12:53:10 +10:00
evdev-tablet.c tablet: fix handling of AttrPressureRange quirk 2026-02-24 12:46:18 +10:00
evdev-tablet.h meson.build: change from config.set10() and #if to config.set() and #ifdef 2025-07-28 12:04:09 +10:00
evdev-totem.c Switch our internal dispatch interface to take an evdev frame 2025-07-02 06:53:05 +00:00
evdev.c evdev: move the SYN_REPORT 1 filtering to the touchpad backend 2025-07-31 00:50:30 +00:00
evdev.h plugin: add hooks to disable internal features 2025-08-07 10:21:36 +10:00
filter-custom.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-flat.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-low-dpi.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-mouse.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-private.h filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-tablet.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
filter-touchpad-flat.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-touchpad-x230.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-touchpad.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-trackpoint-flat.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter-trackpoint.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter.c filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
filter.h filter: differentiate scroll wheel from button scrolling to fix wheel speed 2025-11-11 14:43:41 +10:00
libinput-feature.h touchpad: allow disabling palm detection altogether 2025-08-07 10:23:30 +10:00
libinput-git-version.h.in tools: add the git version in the libinput-record output 2018-03-06 14:22:30 +10:00
libinput-log.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-button-debounce.c plugin: don't initialize the debounce plugin on a virtual device 2025-08-28 01:56:12 +00:00
libinput-plugin-button-debounce.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-lua.c lua: force text mode for loading plugins 2026-04-02 10:15:04 +10:00
libinput-plugin-lua.h plugins: add support for lua plugins to change evdev event streams 2025-08-01 16:04:09 +10:00
libinput-plugin-mouse-wheel-lowres.c plugin: register plugins for the plugin-specific usages 2025-08-01 14:29:44 +10:00
libinput-plugin-mouse-wheel-lowres.h plugins: add a plugin to emulate high-resolution wheel events 2025-07-14 11:14:15 +10:00
libinput-plugin-mouse-wheel.c quirks: Rename QUIRK_MODEL_LOGITECH_MX_MASTER_3 2025-10-23 21:51:35 +00:00
libinput-plugin-mouse-wheel.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-mtdev.c Move mtdev into a plugin 2025-07-02 06:53:05 +00:00
libinput-plugin-mtdev.h Move mtdev into a plugin 2025-07-02 06:53:05 +00:00
libinput-plugin-private.h plugin: remove a leftover function 2025-07-15 10:51:42 +10:00
libinput-plugin-system.h plugins: add meson option to autoload plugins 2025-10-31 05:25:29 +00:00
libinput-plugin-tablet-double-tool.c plugin: remove the event frame callbacks when disabling a plugin 2025-08-19 15:22:49 +10:00
libinput-plugin-tablet-double-tool.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-tablet-eraser-button.c plugin: register plugins for the plugin-specific usages 2025-08-01 14:29:44 +10:00
libinput-plugin-tablet-eraser-button.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-tablet-forced-tool.c tablet: after three valid prox out events, unload the forced prox plugin 2025-12-08 10:27:37 +10:00
libinput-plugin-tablet-forced-tool.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin-tablet-proximity-timer.c plugin: remove the proximity timer callback after prox out events 2025-08-31 00:18:59 +00:00
libinput-plugin-tablet-proximity-timer.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-plugin.c plugins: add meson option to autoload plugins 2025-10-31 05:25:29 +00:00
libinput-plugin.h plugin: add hooks to disable internal features 2025-08-07 10:21:36 +10:00
libinput-private-config.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-private-config.h gesutures: allow to configure hold gestures 2021-06-09 01:18:58 +00:00
libinput-private.h plugin: don't initialize the debounce plugin on a virtual device 2025-08-28 01:56:12 +00:00
libinput-restore-selinux-context.sh meson: Fix absolute libdir case in install script 2018-02-16 16:57:30 +10:00
libinput-util.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
libinput-version.h.in COPYING: Update boilerplate from MIT X11 to MIT Expat license 2015-06-16 14:36:04 +10:00
libinput-versionsort.h Fix clang-tidy false positives 2025-11-06 23:31:27 +00:00
libinput.c plugin: don't initialize the debounce plugin on a virtual device 2025-08-28 01:56:12 +00:00
libinput.h doc: fix a few miss-hyphenated disable-while-typing comments 2025-12-08 10:27:42 +10:00
libinput.sym Add a public plugin system to libinput 2025-08-01 15:38:39 +10:00
path-seat.c plugins: add meson option to autoload plugins 2025-10-31 05:25:29 +00:00
quirks.c Fix clang-tidy false positives 2025-11-06 23:31:27 +00:00
quirks.h quirks: Rename QUIRK_MODEL_LOGITECH_MX_MASTER_3 2025-10-23 21:51:35 +00:00
timer.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
timer.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
udev-seat.c plugins: add meson option to autoload plugins 2025-10-31 05:25:29 +00:00
udev-seat.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-backtrace.h meson.build: change from config.set10() and #if to config.set() and #ifdef 2025-07-28 12:04:09 +10:00
util-bits.h util: silence two clang-tidy false positives 2025-08-06 07:34:55 +00:00
util-files.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-files.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-input-event.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-libinput.c util: print nonchanged axis with a space instead of a * 2025-08-18 23:11:03 +00:00
util-libinput.h Move the event printing out into a utility 2025-03-13 06:13:38 +00:00
util-list.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-list.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-macros.h util: mark the various bitmask functions as nonnull 2025-08-06 07:34:54 +00:00
util-matrix.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-mem.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-multivalue.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-newtype.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-prop-parsers.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-prop-parsers.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-range.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-ratelimit.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-ratelimit.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-stringbuf.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-strings.c Fix clang-tidy false positives 2025-11-06 23:31:27 +00:00
util-strings.h util: sanitize control characters in str_sanitize() 2026-06-04 10:32:28 +10:00
util-time.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-udev.h Run clang-format over the code 2025-07-01 16:42:44 +10:00