Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893530 (CVE-2022-46663) - <sys-apps/less-608-r2: less -R filtering bypass
Summary: <sys-apps/less-608-r2: less -R filtering bypass
Alias: CVE-2022-46663
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
Whiteboard: A3 [glsa? cleanup]
Depends on: 894482
  Show dependency tree
Reported: 2023-02-07 19:35 UTC by Sam James
Modified: 2023-02-24 15:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-07 19:35:33 UTC


I discovered a way to bypass the escape sequence filtering performed
by less -R due to incorrect terminal state machine handling.

The fix is:
but not yet part of any less release.

An example that results in a DoS in xterm or iTerm 2 is:
printf "\e]8;;\e0m\e[>0q" > less-example-xtversion
less -R less-example-xtversion

This has the result of getting the terminal to reply with something
like "\eP>|name version". The "P" there makes less scroll up, the ">"
makes it scroll down, and then it prints the same thing to the tty,
rinse, repeat.

This affects GNU less >= 566 (and <609, but version 608 is the last
public release, the later version numbers are snapshots).

Comment 1 Larry the Git Cow gentoo-dev 2023-02-09 03:54:47 UTC
The bug has been referenced in the following commit(s):

commit 91641abac0747b8c2b701acb7acfc6d7e3f82c37
Author:     Sam James <>
AuthorDate: 2023-02-09 03:45:58 +0000
Commit:     Sam James <>
CommitDate: 2023-02-09 03:54:09 +0000

    sys-apps/less: patch CVE-2022-46663
    Signed-off-by: Sam James <>

 sys-apps/less/files/less-608-CVE-2022-46663.patch | 22 +++++++++
 sys-apps/less/less-608-r2.ebuild                  | 60 +++++++++++++++++++++++
 2 files changed, 82 insertions(+)