The latest tagged release. There are no long-lived release branches, so a fix ships in the next tag rather than being backported.
Use GitHub's private vulnerability reporting on this repository (Security → Report a vulnerability). It stays private until a fix ships. The organisation's security policy covers the rest, safe harbour included.
Please do not open a public issue for a suspected vulnerability first.
- A scanned folder's contents, which may be hostile: a symlink or crafted path must not lead
Clamd.ScanorAMSI.Scanto read a file outside the folder (the walk and every open go through oneos.Root).Commandhands the folder to the caller's program, which reads it by its own rules. - A clamd reply:
parseReplyreads at most 4 KiB and must not panic or report a file clean on an unrecognised answer; it is an error. - A file of any size: it is streamed in fixed chunks, never loaded whole by clamd scans, and a file over clamd's limit must be a failed scan, not a clean one.
- A default-list clamd socket: another local user must not be able to stand in for the daemon, so such a socket counts only when owned by root or a system account (uid below UID_MIN): a path that cannot be stat'ed is refused, and on Linux the connected socket's peer credentials (
SO_PEERCRED) are checked as well, since the path's owner can change after the check. - A scanner's output:
Commandkeeps at most 64 KiB of stdout and 64 KiB of stderr, and a threat name fromCommandor clamd is stripped of control characters and cut to 256 bytes. Stderr of a non-detection exit is aScanError, not a threat name. - A file swapped for a FIFO after the walk: files open non-blocking and a non-regular file is an error, never a clean one.
- An AMSI result in the administrator-blocked range (
0x4000-0x4FFF) is a detection, like a malware result.
- The
Commandline,Command.DetectionCodes, theClamd.Socketand whatClamd.Dialconnects to come from the caller, who is trusted to choose them;Commandruns the program with the caller's privileges and no shell. - A scanner that is wrong, unreachable or evaded is outside the module: a clean result is the antivirus's word, not a proof.
- A file changed after it was scanned is the caller's to prevent.