diff options
| author | 2025-12-06 02:13:05 +0100 | |
|---|---|---|
| committer | 2025-12-06 02:13:05 +0100 | |
| commit | 3ded00c9985a5108cfc7591a309f9a23d57a8cba (patch) | |
| tree | 4d144bc3a87cb6e63e776edb9cad3e0211a64dc7 | |
| parent | 2efa75a0a9ca73f2a5b6ec71e5ae6cb43cdab580 (diff) | |
| download | usbmuxd-master.tar.gz usbmuxd-master.tar.bz2 | |
A path traversal vulnerability was discovered in usbmuxd that allows
arbitrary, unprivileged local users to delete and create files named
`*.plist` as the `usbmux` user.
See https://bugzilla.opensuse.org/show_bug.cgi?id=1254302
| -rw-r--r-- | src/conf.c | 17 |
1 files changed, 12 insertions, 5 deletions
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <libgen.h> | 34 | #include <libgen.h> |
| 35 | #include <sys/stat.h> | 35 | #include <sys/stat.h> |
| 36 | #include <errno.h> | 36 | #include <errno.h> |
| 37 | #include <ctype.h> | ||
| 37 | 38 | ||
| 38 | #include <libimobiledevice-glue/utils.h> | 39 | #include <libimobiledevice-glue/utils.h> |
| 39 | #include <plist/plist.h> | 40 | #include <plist/plist.h> |
| @@ -425,13 +426,19 @@ int config_set_device_record(const char *udid, char* record_data, uint64_t recor | |||
| 425 | if (!udid || !record_data || record_size < 8) | 426 | if (!udid || !record_data || record_size < 8) |
| 426 | return -EINVAL; | 427 | return -EINVAL; |
| 427 | 428 | ||
| 428 | plist_t plist = NULL; | 429 | /* verify udid input */ |
| 429 | if (memcmp(record_data, "bplist00", 8) == 0) { | 430 | const char* u = udid; |
| 430 | plist_from_bin(record_data, record_size, &plist); | 431 | while (*u != '\0') { |
| 431 | } else { | 432 | if (!isalnum(*u) && (*u != '-')) { |
| 432 | plist_from_xml(record_data, record_size, &plist); | 433 | usbmuxd_log(LL_ERROR, "ERROR: %s: udid contains invalid character.\n", __func__); |
| 434 | return -EINVAL; | ||
| 435 | } | ||
| 436 | u++; | ||
| 433 | } | 437 | } |
| 434 | 438 | ||
| 439 | plist_t plist = NULL; | ||
| 440 | plist_from_memory(record_data, record_size, &plist, NULL); | ||
| 441 | |||
| 435 | if (!plist || plist_get_node_type(plist) != PLIST_DICT) { | 442 | if (!plist || plist_get_node_type(plist) != PLIST_DICT) { |
| 436 | if (plist) | 443 | if (plist) |
| 437 | plist_free(plist); | 444 | plist_free(plist); |
