SHA256
3
0
forked from pool/libnbd

22 Commits

Author SHA256 Message Date
6fa7c6c570 - bsc#1253059 - libnbd: Unsanitized hostnames in nbd+ssh URIs allow
remote execution
  uri-Sanitize-user-provided-hostnames.patch
2025-11-20 11:36:02 -07:00
17ee696f58 Accepting request 1277278 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/1277278
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=19
2025-05-14 15:01:29 +00:00
6e28c3a3e1 - Update to version 1.22.2
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libnbd?expand=0&rev=39
2025-05-14 03:48:50 +00:00
7fbfba6fd8 Accepting request 1208903 from Virtualization
Updated libnbd package for Factory. A missing 'jsc' number was added
to an old changelog entry in order to submit the same package to
Factory, SLE15-SP7:GA, and SLFO:Main.

OBS-URL: https://build.opensuse.org/request/show/1208903
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=18
2024-10-20 08:04:34 +00:00
35b399270b - Update to version 1.20.3, jsc#PED-8910
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libnbd?expand=0&rev=37
2024-10-18 17:14:10 +00:00
2f540ab07e Accepting request 1191749 from Virtualization
- Update to version 1.20.2:
  * CVE-2024-7383 (bsc#1228872)

OBS-URL: https://build.opensuse.org/request/show/1191749
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=17
2024-08-06 07:08:02 +00:00
187457b473 - Update to version 1.20.2:
* CVE-2024-7383 (bsc#1228872)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libnbd?expand=0&rev=35
2024-08-05 16:34:15 +00:00
292474e6b5 Accepting request 1168944 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/1168944
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=16
2024-04-19 17:14:34 +00:00
1f8f2598f9 Accepting request 1133223 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/1133223
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=15
2023-12-15 20:48:41 +00:00
5fa83b5ca0 Accepting request 1125731 from Virtualization
- Fix assertion in ext-mode BLOCK_STATUS, CVE-2023-5871
  4451e5b6-CVE-2023-5871.patch
  bsc#1216769

OBS-URL: https://build.opensuse.org/request/show/1125731
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=14
2023-11-14 20:42:25 +00:00
db83d7108f Accepting request 1121701 from Virtualization
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1121701
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=13
2023-11-01 21:11:03 +00:00
b9e034849b Accepting request 1114449 from Virtualization
- Update to version 1.18.0:
  * CVE-2023-5215 (bsc#1215799)
  * docs: Add link to nbd_get_size announcement in release notes
  * docs: Add URL to list post on nbd_get_size security
  * docs: Update release notes for nbd_get_size backport to 1.16.5
  * docs: Finalize release notes for release tomorrow
  * dump: Add more examples of running subprocesses from nbddump
  * info: Tolerate missing size
  * block_status: Fix assertion on bad 64-bit block status reply
  * block_status: Fix assertion with large server size
  * api: Sanitize sizes larger than INT64_MAX

OBS-URL: https://build.opensuse.org/request/show/1114449
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=12
2023-10-01 19:22:21 +00:00
866cbccbed Accepting request 1074037 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/1074037
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=11
2023-03-24 14:21:24 +00:00
600097a89e Accepting request 1011047 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/1011047
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=10
2022-10-15 14:38:08 +00:00
204847235e Accepting request 988220 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/988220
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=9
2022-07-12 09:12:22 +00:00
5c041faea8 Accepting request 980135 from Virtualization
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/980135
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=8
2022-06-01 15:34:37 +00:00
24b95cd094 Accepting request 978761 from Virtualization
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/978761
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=7
2022-05-24 18:31:20 +00:00
cbfd0d516f Accepting request 952773 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/952773
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=6
2022-02-09 19:39:27 +00:00
0f2e4f9a83 Accepting request 914305 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/914305
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=5
2021-08-26 21:15:06 +00:00
a9b26b2484 Accepting request 903567 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/903567
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=4
2021-07-02 11:27:13 +00:00
c904431b45 Accepting request 898906 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/898906
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=3
2021-06-10 22:18:40 +00:00
b297c46c8f Accepting request 885442 from Virtualization
OBS-URL: https://build.opensuse.org/request/show/885442
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnbd?expand=0&rev=2
2021-04-16 22:01:25 +00:00
7 changed files with 77 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
<services>
<service name="tar_scm" mode="manual">
<param name="filename">libnbd</param>
<param name="revision">v1.22.4</param>
<param name="revision">v1.22.2</param>
<param name="scm">git</param>
<param name="submodules">disable</param>
<param name="url">https://gitlab.com/nbdkit/libnbd.git</param>

View File

@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://gitlab.com/nbdkit/libnbd.git</param>
<param name="changesrevision">caf41ba1847f79ab25e3a73401f8170cbe351908</param></service></servicedata>
<param name="changesrevision">5f55a26f3a776c11049a27154b1f2b59b8c335da</param></service></servicedata>

BIN
libnbd-1.22.2.tar.bz2 LFS Normal file

Binary file not shown.

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3fb6a89c7ef6faf9ade7e1a2914215c9d0b5d2236ea70d044ca70f5a64e007b
size 483984

View File

@@ -1,41 +1,9 @@
-------------------------------------------------------------------
Fri Sep 05 21:02:25 UTC 2025 - Charles Arnold <carnold@suse.com>
Wed Nov 5 11:03:52 MST 2025 - carnold@suse.com
- Update to version 1.22.4:
* Version 1.22.4.
* docs: nbd_connect_uri: Combine export name sections together
* docs: nbd_connect_uri: Minor copyedits
* docs: nbd_connect_uri: Split up URI parsing section
* lib/uri.c: Use uri_query_list functions to free
* lib/uri.c: Add static annotation to parse_bool
* docs: Clarify documentation for export names in nbd_connect_uri
* docs: Add S<...> around qemu versions to avoid distracting linebreak
* generator: rust: Parse S<...> (non-breaking spaces) in POD
* generator: rust: Allow nested X<..X<..>..> expressions in POD
* generator: Don't list nbd_is_uri as a "flag call"
* generator: Clarify documentation for nbd_set_private_data
* ocaml: Small tweaks to the generated documentation
* ci: Remove fedora-40, alpine-320, add fedora-42, alpine-322
* common: utils: Add const to <vector>_duplicate variable decls
* copy, info: Use new vector_array_append functions in a couple of places
* common: utils: vector: Fix vector_uniq prototype and add a test
* common: utils: vector: Add range functions for insert, append and remove
* common: utils: vector: Prefer vector_reset over free()
* common: utils: vector: Add new vector_uniq function
* common/utils: Add convenient string_append_format function
-------------------------------------------------------------------
Thu Jul 31 17:01:32 UTC 2025 - Charles Arnold <carnold@suse.com>
- Update to version 1.22.3:
* Version 1.22.3.
* ublk: Remove unused EXPECTED_VERSION
* todo: Remove a couple of minor features that have been implemented
* info: Tolerate nbdkit slop on large extents
* generator: Avoid const-correctness warnings in golang
* maint: Spelling fixes
* ci: Disable cross-builds of Rust
* rust: Allow cargo build --target $RUST_TARGET to be set
- bsc#1253059 - libnbd: Unsanitized hostnames in nbd+ssh URIs allow
remote execution
uri-Sanitize-user-provided-hostnames.patch
-------------------------------------------------------------------
Tue May 06 22:48:02 UTC 2025 - jfehlig@suse.com

View File

@@ -19,12 +19,13 @@
%define sover 0
Name: libnbd
Version: 1.22.4
Version: 1.22.2
Release: 0
Summary: NBD client library in userspace
License: LGPL-2.1-or-later
URL: https://gitlab.com/nbdkit/libnbd
Source0: %{name}-%{version}.tar.bz2
Patch1: uri-Sanitize-user-provided-hostnames.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes

View File

@@ -0,0 +1,66 @@
Subject: uri: Sanitize user-provided hostnames
From: Eric Blake eblake@redhat.com Mon Oct 13 10:01:21 2025 -0500
Date: Tue Oct 21 15:30:19 2025 -0500:
Git: f461fe64d21fe8a6d32b56ccb50d06489d2e2698
Dan Berrangé ran a free trial of zeropath (http://zeropath.com/) AI
analysis on libnbd, and it highlighted the following:
"When using nbd+ssh:// URIs the library constructs an argv array for
ssh from parsed URI parts (server, port, user, unix socket, nbd-port)
and execs it. The server component is used directly as an ssh
argument; if it begins with '-' an attacker can inject ssh options
(e.g. -oProxyCommand=...) that cause ssh to run local commands. There
is no protection (such as rejecting leading '-' in server or inserting
a '--' to stop option parsing), so an attacker who can supply the URI
can cause local command execution in the client process."
eg with this.... "nbdinfo nbd+ssh://-oProxyCommand=rm%20run.in"
you'll get a failure to start the NBD connection, but it none the less
deletes the file 'run.in' in the local working directory
The RFCs are vague enough that it is not immediately obvious whether
there is any possibility of a valid hostname with a leading - (see
https://www.netmeister.org/blog/hostnames.html). Still, it is better
to pass the user's string on to ssh's determination of a valid
hostname (which does appear to reject leading -) rather than trying to
teach libnbd what patterns to allow, and thereby avoid risking any
pattern written in libnbd accidentally being too restrictive. Do this
by using "--" to end ssh options before the hostname, but that in turn
must come after any use of -oUser=. With this in place, we now get a
sane error rather than spawning a calculator with:
$ nbdinfo nbd+ssh://-oProxyCommand=gnome-calculator
hostname contains invalid characters
/home/eblake/libnbd/info/.libs/nbdinfo: nbd_connect_uri: recv: server disconnected unexpectedly
See also Libvirt commit e4cb8500 (Aug 2017), which in turn was
inspired by GIT security flaws
(http://blog.recurity-labs.com/2017-08-10/scm-vulns). We have put out
a request to Red Hat security on whether this warrants a CVE in
libnbd; however, as the problem was easy to identify using only free
AI resources, and the problem itself is relatively low priority (to
exploit it, an attacker has to convince an admin to run a program that
will use libnbd on an untrusted URI), so we are publishing this now
rather than waiting for any embargo. If a CVE is assigned, it will be
announced to the mailing list in a followup post.
Signed-off-by: Eric Blake <eblake@redhat.com>
CC: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit fffd87a3ba216cf2f9c212e5db96b13b98985edf)
Conflicts:
lib/uri.c - no username override, backport looks different
Signed-off-by: Eric Blake <eblake@redhat.com>
--- a/lib/uri.c
+++ b/lib/uri.c
@@ -446,7 +446,7 @@ nbd_unlocked_aio_connect_uri (struct nbd
case ssh: { /* SSH */
char port_str[32];
const char *ssh_command[] = {
- "ssh", "-p", port_str, uri->server,
+ "ssh", "-p", port_str, "--", uri->server,
"nc",
NULL, /* [5] "-U" or "localhost" */
NULL, /* [6] socket or "10809" */