RustSec logo

History ⋅ Edit ⋅ JSON (OSV)

RUSTSEC-2026-0617

Improper quoting of command arguments in hints enables command injection

Reported
Issued
Package
sqz (crates.io)
Type
Vulnerability
Categories
Aliases
References
Patched
  • >=0.2.0

Description

sq emits hints, which can include a suggested command that the user can run. Some hints are derived from the input and thus can partially be influenced by an attacker. Because the quoting was not careful enough, it was possible to craft a user ID that would be used in the command and when the hint is copy and pasted would execute arbitrary commands. Consider the user ID $(touch /tmp/pwned). If the corresponding certificate is not considered authenticated and the user runs sq verify on a message signed by that certificate, sq would show:

Hint: After checking that FINGERPRINT belongs to $(touch /tmp/pwned),
      you can mark it as authenticated using:

$ sq pki link add --cert=FINGERPRINT --userid="$(touch /tmp/pwned)"

If the user copy and pasted the command, then most shells would create the file /tmp/pwned.

This was fixed by improving the argument quoting.

Advisory available under CC0-1.0 license.