Safeguard
Vulnerability Analysis•

CVE-2022-48624: High Command Injection in less Before Version 606

CVE-2022-48624 is a high severity command injection in the less pager before version 606, via the LESSCLOSE setting. Upgrade to less 606 or later.

Safeguard Security Team
3 min read

CVE-2022-48624 is a high severity (CVSS 7.8) operating system command injection in less, the common terminal pager, before version 606. The close_altfile function omitted shell quoting for LESSCLOSE. Upgrade to less 606 or later or install your distribution's patched package.

What's affected

The NVD description says close_altfile in filename.c in less before 606 omits shell_quote calls for LESSCLOSE. The upstream project's commit is titled Shell-quote filenames when invoking LESSCLOSE and is dated 25 June 2022, in the changes between v605 and v606.

The record was published on 19 February 2024 and cites a Debian LTS announcement and a NetApp advisory, so distributions and vendors that ship less have issued updates. Debian and others backport patches, so a distribution's version string may still read as older than 606 while containing the fix.

How to check if you're exposed

Run less --version and read the first line. Anything below 606 is affected upstream. On Debian or Ubuntu, apt changelog less shows whether the fix was backported, and on Fedora or RHEL rpm -q --changelog less | head serves the same purpose.

Also check whether LESSCLOSE is set in any environment, with env | grep LESS. If it is unset, the quoting bug has nothing to act on. Run your Safeguard scan or the free in-browser dependency scan at gold.safeguard.sh/scan against your manifests or SBOM to see whether this package is in your tree, including as a transitive dependency.

What to do now

  1. Update less to 606 or later, or apply the distribution's security update.
  2. Rebuild container images that include less, since base images may carry an old copy.
  3. Avoid opening files with unusual names in less on systems that have LESSCLOSE set.
  4. Set LESSOPEN and LESSCLOSE only when you need them, and prefer fixed, reviewed scripts.
  5. Check appliances and embedded devices that ship less, and ask the vendor for fixes.

Why it matters

CWE-78 is OS command injection. The program builds a shell command from a filename and runs it. When the filename is not quoted, shell metacharacters in it are interpreted by the shell, so the name can become part of the command.

The vector is local and needs low privileges, so this is mostly relevant where an attacker can make a user or a script run less on a file name they control, as with shared directories or automated log viewing. KEV is false. Small utilities like pagers are everywhere, in base images and appliances, which is why they deserve a place in a software inventory.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Does it affect me if LESSCLOSE is unset?

The flawed code relates to the LESSCLOSE command. If you never set it, the exposed path is much smaller, but updating is still the safe route.

Which version fixes it?

less 606.

Sources

You can also run the free in-browser dependency scan at gold.safeguard.sh/scan to see which known vulnerabilities your dependencies carry.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

We email you a link to confirm, and only then add you to the list. Unsubscribe in one click. Privacy

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.