diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2026-01-09 11:28:43 +0530 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-09 08:29:04 +0100 |
| commit | 634719db25851f20d2c8cb62e0e9d651c0d672c8 (patch) | |
| tree | 983a970fe4a8d8f2f753e55898b7872bbecdce91 | |
| parent | 2236de2bd3151b306c4676f604d90191cfe754ae (diff) | |
| download | meta-openembedded-634719db25851f20d2c8cb62e0e9d651c0d672c8.tar.gz | |
wireshark: fix CVE-2025-11626
Upstream-Status: Backport from https://gitlab.com/wireshark/wireshark/-/commit/513e5d49724f4a0695c5d2a08ce422c09cb999c8
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
| -rw-r--r-- | meta-networking/recipes-support/wireshark/files/CVE-2025-11626.patch | 99 | ||||
| -rw-r--r-- | meta-networking/recipes-support/wireshark/wireshark_3.4.12.bb | 1 |
2 files changed, 100 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/wireshark/files/CVE-2025-11626.patch b/meta-networking/recipes-support/wireshark/files/CVE-2025-11626.patch new file mode 100644 index 0000000000..e5b3e6c0ac --- /dev/null +++ b/meta-networking/recipes-support/wireshark/files/CVE-2025-11626.patch | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | From 4c79e54f4294b49a6549ae52b7b0a56b27540a40 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: John Thacker <johnthacker@gmail.com> | ||
| 3 | Date: Mon, 22 Sep 2025 21:41:00 -0400 | ||
| 4 | Subject: [PATCH] Mongo: Avoid infinite loop in dissect_op_msg_section | ||
| 5 | |||
| 6 | If the size of a a OP_MSG data section is indicated as -1, that | ||
| 7 | leads to advancing the offset by section_len + 1, or zero, which | ||
| 8 | causes an infinite loop. | ||
| 9 | |||
| 10 | The total message and section lengths in Mongo are signed int32s; | ||
| 11 | it is impossible for them to be negative, and impossible for the | ||
| 12 | section length to be INT_MAX (since the message length includes | ||
| 13 | the length of the four byte headers and flag bits.) | ||
| 14 | |||
| 15 | Throw an error to avoid the offset moving backwards, an infinite loop, | ||
| 16 | or signed integer overflow. | ||
| 17 | |||
| 18 | Also update some URLs to their new locations. | ||
| 19 | |||
| 20 | Fix #20724. | ||
| 21 | |||
| 22 | (backported from commit 1ec4709cab382f7077ba66d2e382c2e75ce335c1) | ||
| 23 | |||
| 24 | CVE: CVE-2025-11626 | ||
| 25 | Upstream-Status: Backport [https://gitlab.com/wireshark/wireshark/-/commit/513e5d49724f4a0695c5d2a08ce422c09cb999c8] | ||
| 26 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 27 | --- | ||
| 28 | epan/dissectors/packet-mongo.c | 20 ++++++++++++++++---- | ||
| 29 | 1 file changed, 16 insertions(+), 4 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/epan/dissectors/packet-mongo.c b/epan/dissectors/packet-mongo.c | ||
| 32 | index 44cfde8..8290275 100644 | ||
| 33 | --- a/epan/dissectors/packet-mongo.c | ||
| 34 | +++ b/epan/dissectors/packet-mongo.c | ||
| 35 | @@ -12,17 +12,19 @@ | ||
| 36 | |||
| 37 | /* | ||
| 38 | * See Mongo Wire Protocol Specification | ||
| 39 | - * http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol | ||
| 40 | + * https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/ | ||
| 41 | * See also BSON Specification | ||
| 42 | - * http://bsonspec.org/#/specification | ||
| 43 | + * http://bsonspec.org/spec.html | ||
| 44 | */ | ||
| 45 | |||
| 46 | #include "config.h" | ||
| 47 | |||
| 48 | +#include <stdint.h> | ||
| 49 | #include <epan/packet.h> | ||
| 50 | #include <epan/exceptions.h> | ||
| 51 | #include <epan/expert.h> | ||
| 52 | #include <epan/proto_data.h> | ||
| 53 | +#include <epan/exceptions.h> | ||
| 54 | #include "packet-tcp.h" | ||
| 55 | #include "packet-tls.h" | ||
| 56 | #ifdef HAVE_SNAPPY | ||
| 57 | @@ -278,6 +280,7 @@ static gint ett_mongo_doc_sequence= -1; | ||
| 58 | |||
| 59 | static expert_field ei_mongo_document_recursion_exceeded = EI_INIT; | ||
| 60 | static expert_field ei_mongo_document_length_bad = EI_INIT; | ||
| 61 | +static expert_field ei_mongo_section_size_bad = EI_INIT; | ||
| 62 | static expert_field ei_mongo_unknown = EI_INIT; | ||
| 63 | static expert_field ei_mongo_unsupported_compression = EI_INIT; | ||
| 64 | static expert_field ei_mongo_too_large_compressed = EI_INIT; | ||
| 65 | @@ -784,13 +787,21 @@ dissect_op_msg_section(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tr | ||
| 66 | gint section_len = -1; /* Section length */ | ||
| 67 | |||
| 68 | e_type = tvb_get_guint8(tvb, offset); | ||
| 69 | - section_len = tvb_get_letohl(tvb, offset+1); | ||
| 70 | |||
| 71 | - ti = proto_tree_add_item(tree, hf_mongo_msg_sections_section, tvb, offset, 1 + section_len, ENC_NA); | ||
| 72 | + ti = proto_tree_add_item(tree, hf_mongo_msg_sections_section, tvb, offset, 1, ENC_NA); | ||
| 73 | section_tree = proto_item_add_subtree(ti, ett_mongo_section); | ||
| 74 | proto_tree_add_item(section_tree, hf_mongo_msg_sections_section_kind, tvb, offset, 1, ENC_LITTLE_ENDIAN); | ||
| 75 | offset += 1; | ||
| 76 | |||
| 77 | + section_len = tvb_get_letohil(tvb, offset); | ||
| 78 | + /* The section length must be strictly smaller than the total message size, | ||
| 79 | + * both signed int32s. This prevents signed integer overflow. */ | ||
| 80 | + if (section_len < 0 || section_len == INT32_MAX) { | ||
| 81 | + proto_tree_add_expert_format(section_tree, pinfo, &ei_mongo_section_size_bad, tvb, offset, 4, "Bogus Mongo message section size: %i", section_len); | ||
| 82 | + THROW(ReportedBoundsError); | ||
| 83 | + } | ||
| 84 | + proto_item_set_len(ti, 1 + section_len); | ||
| 85 | + | ||
| 86 | switch (e_type) { | ||
| 87 | case KIND_BODY: | ||
| 88 | dissect_bson_document(tvb, pinfo, offset, section_tree, hf_mongo_msg_sections_section_body); | ||
| 89 | @@ -1445,6 +1456,7 @@ proto_register_mongo(void) | ||
| 90 | static ei_register_info ei[] = { | ||
| 91 | { &ei_mongo_document_recursion_exceeded, { "mongo.document.recursion_exceeded", PI_MALFORMED, PI_ERROR, "BSON document recursion exceeds", EXPFILL }}, | ||
| 92 | { &ei_mongo_document_length_bad, { "mongo.document.length.bad", PI_MALFORMED, PI_ERROR, "BSON document length bad", EXPFILL }}, | ||
| 93 | + { &ei_mongo_section_size_bad, { "mongo.msg.sections.section.size.bad", PI_MALFORMED, PI_ERROR, "Bogus Mongo message section size", EXPFILL }}, | ||
| 94 | { &ei_mongo_unknown, { "mongo.unknown.expert", PI_UNDECODED, PI_WARN, "Unknown Data (not interpreted)", EXPFILL }}, | ||
| 95 | { &ei_mongo_unsupported_compression, { "mongo.unsupported_compression.expert", PI_UNDECODED, PI_WARN, "This packet was compressed with an unsupported compressor", EXPFILL }}, | ||
| 96 | { &ei_mongo_too_large_compressed, { "mongo.too_large_compressed.expert", PI_UNDECODED, PI_WARN, "The size of the uncompressed packet exceeded the maximum allowed value", EXPFILL }}, | ||
| 97 | -- | ||
| 98 | 2.50.1 | ||
| 99 | |||
diff --git a/meta-networking/recipes-support/wireshark/wireshark_3.4.12.bb b/meta-networking/recipes-support/wireshark/wireshark_3.4.12.bb index 0cc0dfa3d7..afee5561c4 100644 --- a/meta-networking/recipes-support/wireshark/wireshark_3.4.12.bb +++ b/meta-networking/recipes-support/wireshark/wireshark_3.4.12.bb | |||
| @@ -32,6 +32,7 @@ SRC_URI += " \ | |||
| 32 | file://CVE-2023-6175.patch \ | 32 | file://CVE-2023-6175.patch \ |
| 33 | file://CVE-2024-2955.patch \ | 33 | file://CVE-2024-2955.patch \ |
| 34 | file://CVE-2025-13499.patch \ | 34 | file://CVE-2025-13499.patch \ |
| 35 | file://CVE-2025-11626.patch \ | ||
| 35 | " | 36 | " |
| 36 | 37 | ||
| 37 | UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src" | 38 | UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src" |
