libinput/src
Peter Hutterer 71a2c5cae2 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
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1486>
2026-06-03 21:45:28 +00:00
..
builddir.h meson: revamp the debug build detection for the builddir lookup 2026-01-10 10:39:21 +00:00
evdev-fallback.c evdev: rename evdev_paired_keyboard to evdev_paired_device 2026-01-28 00:43:36 +00:00
evdev-fallback.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-frame.h evdev: store the SYN_REPORT value in the frame 2026-03-19 00:09:30 +00:00
evdev-middle-button.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-mt-touchpad-buttons.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-mt-touchpad-edge-scroll.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-mt-touchpad-gestures.c touchpad: time the 3fg fast swipe timeout from the initial contact 2026-04-17 02:32:50 +00:00
evdev-mt-touchpad-tap.c touchpad: support automatic drag-lock when releasing at the edge 2026-03-24 05:50:24 +00:00
evdev-mt-touchpad-thumb.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-mt-touchpad.c touchpad: fix the libwacom_is_reversible() check on the paired device 2026-05-26 10:51:28 +10:00
evdev-mt-touchpad.h touchpad: support automatic drag-lock when releasing at the edge 2026-03-24 05:50:24 +00:00
evdev-plugin.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
evdev-plugin.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
evdev-tablet-pad-leds.c tablet-pad: use strdup_printf in sysfs path construction 2026-04-16 04:55:23 +00:00
evdev-tablet-pad.c pad: ignore invalid strip axis values 2026-06-03 21:45:28 +00: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: extend touch arbitration rect to cover full tablet height 2026-04-16 05:10:53 +00: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 totem: require both touch size axes to have resolution 2026-06-03 21:45:28 +00:00
evdev.c evdev: be stricter about devices with odd absinfo values 2026-06-03 21:45:28 +00:00
evdev.h touchpad: don't disable on external mice until we see an event 2026-01-28 00:43:37 +00:00
filter-custom.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-flat.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-low-dpi.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-mouse.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-private.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-tablet.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-touchpad-flat.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-touchpad-x230.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-touchpad.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-trackpoint-flat.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter-trackpoint.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
filter.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00: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 Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +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 util: add a free_clear() helper to reset after free 2026-04-24 00:24:24 +00: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 plugin: always disable wheel debouncing on request 2026-01-13 21:52:52 +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 Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +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 Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00: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-11-26 10:55:03 +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 Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +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 plugin: use safe_strdup() instead of strdup() 2026-04-22 04:53:13 +00:00
libinput-plugin.h Fix various typos 2026-03-24 05:09:07 +00: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 touchpad: add get_default_timeout for dwt and dwtp 2026-02-03 13:01:59 +10: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 util: add guards for the etrace/trace defines 2026-02-04 11:18:54 +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 tablet: fix eraser button get_default_mode/get_default_button return values 2026-03-17 00:46:45 +00:00
libinput.h doc: add HOLD_END to libinput_event_gesture_get_cancelled() doc 2026-04-20 01:10:05 +00:00
libinput.sym touchpad: add get_default_timeout for dwt and dwtp 2026-02-03 13:01:59 +10:00
path-seat.c plugins: add meson option to autoload plugins 2025-10-31 05:25:29 +00:00
quirks.c doc: list-quirks should be quirks list 2026-02-20 19:56:46 +01:00
quirks.h quirks: replace ModelPressurepad with setting INPUT_PROP_PRESSUREPAD 2025-12-09 06:07:01 +00:00
timer.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
timer.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00: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 util: use snprintf for PID formatting in backtrace helper 2026-04-16 04:55:23 +00:00
util-bits.h util: add a free_clear() helper to reset after free 2026-04-24 00:24:24 +00:00
util-files.c Fix various typos 2026-03-24 05:09:07 +00:00
util-files.h util: use lstat() instead of stat() in rmdir_r to prevent symlink attacks 2026-04-22 04:53:13 +00:00
util-input-event.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
util-libinput.c Add libinput_tablet_tool_get_name() for the tool's specific name 2026-01-14 16:44:01 +10: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 util: add a free_clear() helper to reset after free 2026-04-24 00:24:24 +00:00
util-multivalue.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
util-newtype.h util: fix documentation issues for newtypes 2025-12-12 04:15:15 +00:00
util-prop-parsers.c quirks: replace ModelPressurepad with setting INPUT_PROP_PRESSUREPAD 2025-12-09 06:07:01 +00: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 Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
util-ratelimit.h Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
util-stringbuf.h util: add a free_clear() helper to reset after free 2026-04-24 00:24:24 +00: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-03 21:45:28 +00:00
util-time.h util: fix remaininig usec computation on 32 bits 2026-03-24 05:24:35 +00:00
util-udev.h Run clang-format over the code 2025-07-01 16:42:44 +10:00