Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update trojan signatures to avoid false positives on modern distros#35927

Open
Miguevrgo wants to merge 1 commit into
4.14.6from
fix/32142-false-positive-on-trojaned-version-of-file-detected-in-debian-13-trixie
Open

Update trojan signatures to avoid false positives on modern distros#35927
Miguevrgo wants to merge 1 commit into
4.14.6from
fix/32142-false-positive-on-trojaned-version-of-file-detected-in-debian-13-trixie

Conversation

@Miguevrgo
Copy link
Copy Markdown
Member

@Miguevrgo Miguevrgo commented May 6, 2026

Description

False positives on "Trojaned version of file detected." (rule 510) triggered on several modern distributions due to signatures matching legitimate strings present in current binary builds.

Closes #32142

Proposed Changes

Minimal signature adjustments in ruleset/rootcheck/db/rootkit_trojans.txt:

Binary Distro Root cause Change
chsh, chfn Debian 13 (Trixie) Modern shadow binaries contain the string bash (e.g. BASH_ENV= from PAM) Removed bash| from signature
chsh, chfn Ubuntu 26.04 /dev/null matched [a-s,uvxz] because n ∈ [a–s] [a-s,uvxz][a-mo-s,uvxz]
passwd Arch Linux, Ubuntu 26.04 /dev/null matched [b-s,uvxz] because n ∈ [b–s] [b-s,uvxz][b-mo-s,uvxz]
date, md5sum Ubuntu 26.04 Symlinks to a uutils-coreutils Rust multicall binary that legitimately embeds /dev/urandom, /dev/random, /dev/stdout, /dev/stdin, /dev/tty, /dev/fd, etc. Widened negated character class: [^cln] / bare /dev/[^cfhlnrstuw]

Real trojan indicators (/dev/kmem, /dev/mem, /dev/ptyXX, /dev/ttyo, etc.) are unaffected — their leading characters (k, m, p, o, …) are not in the excluded set.

Manual Tests with Their Corresponding Evidence

Tests run on Incus containers (Debian 13 Trixie, Arch Linux, Ubuntu 26.04 Resolute).

Methodology

Each binary was inspected with strings and the output was matched against both the old and new signature using grep -P. An empty result means no match → no alert.

Debian 13 — /usr/bin/chsh

Signature: !bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-mo-s,uvxz]!

# Old signature — MATCH (false positive)
$ strings /usr/bin/chsh | grep -P "bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-s,uvxz]"
BASH_ENV=

# New signature — NO MATCH ✅
$ strings /usr/bin/chsh | grep -P "file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-mo-s,uvxz]"
(no output)

Arch Linux — /usr/bin/passwd

Signature: !bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[b-mo-s,uvxz]!

# Old signature — MATCH (false positive)
$ strings /usr/bin/passwd | grep -P "bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[b-s,uvxz]"
/dev/null

# New signature — NO MATCH ✅
$ strings /usr/bin/passwd | grep -P "bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[b-mo-s,uvxz]"
(no output)

Ubuntu 26.04 — /usr/bin/passwd, /usr/bin/chfn, /usr/bin/chsh

Same /dev/nulln in range issue, resolved with [a-mo-s,uvxz] / [b-mo-s,uvxz].

# New signatures — NO MATCH on all three ✅
$ strings /usr/bin/passwd | grep -P "bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[b-mo-s,uvxz]"
(no output)
$ strings /usr/bin/chfn  | grep -P "file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-mo-s,uvxz]"
(no output)
$ strings /usr/bin/chsh  | grep -P "file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-mo-s,uvxz]"
(no output)

Ubuntu 26.04 — /usr/bin/date and /usr/bin/md5sum (uutils multicall)

Both are symlinks to /usr/lib/cargo/bin/coreutils/date (uutils-coreutils 0.8.0, Rust).

# Old signature for date — MATCH (false positive)
$ strings /usr/lib/cargo/bin/coreutils/date | grep -P "/dev/[^cln]" | grep -oP "/dev/." | sort -u
/dev/f
/dev/r
/dev/s
/dev/t
/dev/u
/dev/w

# New signature for date — NO MATCH ✅
$ strings /usr/lib/cargo/bin/coreutils/date | grep -P "/dev/[^cfhlnrstuw]" | grep -oP "/dev/." | sort -u
(no output)

# Old signature for md5sum — MATCH (false positive, bare /dev/)
# New signature for md5sum — NO MATCH ✅
$ strings /usr/lib/cargo/bin/coreutils/md5sum | grep -P "/dev/[^cfhlnrstuw]"
(no output)

Review Checklist

  • Code changes reviewed
  • Relevant evidence provided
  • Tests cover the new functionality (manual validation on all affected distros)
  • Configuration changes documented (N/A)
  • Developer documentation reflects the changes (N/A)
  • Meets requirements and/or definition of done
  • No unresolved dependencies with other issues

…modern distros

Signatures for chsh, chfn, passwd, date and md5sum were triggering false
positives on Debian 13 (Trixie), Arch Linux and Ubuntu 26.04 because
modern binaries legitimately contain strings such as 'bash', '/dev/null',
'/dev/urandom' or '/dev/stdout'.

- chsh, chfn: remove 'bash' from signature; exclude 'n' (/dev/null) from
  the character-class range
- passwd: exclude 'n' (/dev/null) from the character-class range
- date, md5sum: widen the excluded-character set in /dev/[^...] to also
  skip f, h, r, s, t, u, w — characters present in the legitimate device
  paths (/dev/fd, /dev/hda help text, /dev/random, /dev/stdin, /dev/stdout,
  /dev/tty, /dev/urandom, /dev/who-idle) embedded in the uutils-coreutils
  multicall binary shipped by Ubuntu 26.04
@Miguevrgo Miguevrgo requested a review from a team as a code owner May 6, 2026 10:17
@Miguevrgo Miguevrgo changed the title fix(rootcheck): update trojan signatures to avoid false positives on modern distros Update trojan signatures to avoid false positives on modern distros May 6, 2026
@Miguevrgo Miguevrgo changed the base branch from main to 4.14.6 May 6, 2026 10:19
@Miguevrgo Miguevrgo removed the request for review from a team May 6, 2026 10:20
@Miguevrgo Miguevrgo self-assigned this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive on "Trojaned version of file detected." in Debian 13 (Trixie)

1 participant