qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal
@ 2024-08-02 19:26 Eric Blake
  2024-08-02 19:26 ` [PATCH 1/2] util: Refactor json-writer's string sanitizer to be public Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Eric Blake @ 2024-08-02 19:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, rjones

I've requested a CVE from Red Hat, and hope to have an assigned number
soon.  Meanwhile, we can get review started, to make sure this is
ready to include in 9.1.  'qemu-img info' should never print untrusted
data in a way that might take over a user's terminal.

There are probably other spots where qemu-img info is printing
untrusted data (such as filenames), where we probably ought to use the
same sanitization tactics as shown here.  Identifying those spots
would be a useful part of this review, and may mean a v2 that is even
more extensive in the number of patches.

In patch 1, I created mod_utf8_sanitize_len(), with the intent that I
could sanitize just a prefix of a string without having to copy it
into a NUL-terminated buffer.  I didn't end up needing it in my
current version of patch 2 (since the code was already copying to a
NUL-terminated buffer for trace purposes), but we may find uses for
it; in fact, it raises the question of whether any of our trace_ calls
need to sanitize untrusted data (or whether we can rely on ALL trace
engines to be doing that on our behalf, already).

Eric Blake (2):
  util: Refactor json-writer's string sanitizer to be public
  qemu-img: CVE-XXX Sanitize untrusted output from NBD server

 include/qemu/unicode.h |  3 ++
 nbd/client.c           |  5 ++-
 qobject/json-writer.c  | 47 +----------------------
 util/unicode.c         | 84 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 92 insertions(+), 47 deletions(-)

-- 
2.45.2



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-08-08 14:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02 19:26 [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal Eric Blake
2024-08-02 19:26 ` [PATCH 1/2] util: Refactor json-writer's string sanitizer to be public Eric Blake
2024-08-02 21:00   ` Richard W.M. Jones
2024-08-02 21:38   ` Philippe Mathieu-Daudé
2024-08-07 18:49   ` Daniel P. Berrangé
2024-08-08  7:57     ` Markus Armbruster
2024-08-08  7:54   ` Markus Armbruster
2024-08-08 14:02     ` Eric Blake
2024-08-02 19:26 ` [PATCH 2/2] qemu-img: CVE-XXX Sanitize untrusted output from NBD server Eric Blake
2024-08-02 21:03   ` Richard W.M. Jones
2024-08-07 18:45     ` Daniel P. Berrangé
2024-08-02 21:41   ` Philippe Mathieu-Daudé
2024-08-07 13:43     ` Stefan Hajnoczi
2024-08-02 22:01   ` Richard W.M. Jones
2024-08-03  8:20     ` Richard W.M. Jones
2024-08-05 18:48 ` [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal Eric Blake
2024-08-05 19:11   ` Richard W.M. Jones
2024-08-07 17:51     ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).