镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From c9da977c178fbfc0e4caf99f9fdf5dc433d6fcc2 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@gnome.org>
Subject: [PATCH] Backport D-Bus introspection node nesting fix

Upstream commit: https://github.com/GNOME/glib/commit/c9da977c178fbfc0e4caf99f9fdf5dc433d6fcc2
Fixes: CVE-2026-58016

The upstream parser fix and regression vectors are unchanged. The test
registration path is adapted to GLib 2.88.3's existing test names.
---
diff --git a/gio/gdbusintrospection.c b/gio/gdbusintrospection.c
index df5daa32..78a63e2a 100644
--- a/gio/gdbusintrospection.c
+++ b/gio/gdbusintrospection.c
@@ -1261 +1261 @@ parser_start_element (GMarkupParseContext *context,
- if (!(g_slist_length (stack) >= 1 || strcmp (stack->next->data, "node") != 0))
+ if (stack->next != NULL && strcmp (stack->next->data, "node") != 0)
diff --git a/gio/tests/gdbus-introspection.c b/gio/tests/gdbus-introspection.c
index cb99c941..fccdcff5 100644
--- a/gio/tests/gdbus-introspection.c
+++ b/gio/tests/gdbus-introspection.c
@@ -302,0 +303,32 @@ test_extra_data (void)
+static void
+test_invalid (void)
+{
+ const struct
+ {
+ const char *xml;
+ GMarkupError expected_error_code;
+ }
+ vectors[] =
+ {
+ { "", G_MARKUP_ERROR_EMPTY },
+ { "<node><interface name=\"I\"><method name=\"M\"><node><interface name=\"I2\"></interface></node></method>", G_MARKUP_ERROR_INVALID_CONTENT },
+ { "<node><interface name=\"I\"><signal name=\"S\"><node><interface name=\"I2\"><signal name=\"S2\"></signal></interface></node></signal>", G_MARKUP_ERROR_INVALID_CONTENT },
+ { "<node><interface name=\"I\"><property name=\"P\" type=\"s\" access=\"read\"><node><interface name=\"I2\"></interface></node></property>", G_MARKUP_ERROR_INVALID_CONTENT },
+ { "<node><interface name=\"I\"><method name=\"M\"><arg type=\"\"><node><interface name=\"I2\"><method name=\"M2\"></method></interface></node></arg>", G_MARKUP_ERROR_INVALID_CONTENT },
+ };
+
+ for (size_t i = 0; i < G_N_ELEMENTS (vectors); i++)
+ {
+ GDBusNodeInfo *node;
+ GError *local_error = NULL;
+
+ g_test_message ("Testing parsing of %s gives an error", vectors[i].xml);
+
+ node = g_dbus_node_info_new_for_xml (vectors[i].xml, &local_error);
+ g_assert_error (local_error, G_MARKUP_ERROR, (int) vectors[i].expected_error_code);
+ g_assert_null (node);
+
+ g_clear_error (&local_error);
+ }
+}
+
@@ -319,0 +352 @@ main (int argc,
+ g_test_add_func ("/gdbus/introspection-invalid", test_invalid);
11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
overlays = [
(import rust-overlay)
(final: prev: {
# Backport GNOME/glib@c9da977c for the Linux desktop bundle.
# Remove this when the pinned nixpkgs GLib changes to a fixed build.
glib =
if prev.stdenv.hostPlatform.isLinux && prev.glib.version == "2.88.3" then
prev.glib.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [
./apps/maple-research/frontend/src-tauri/patches/glib-dbus-introspection-cve-2026-58016.patch
];
})
else
prev.glib;
# Keep bun on versions.bun (and setup-bun's Windows pin) when nixpkgs moves ahead.
bun = prev.bun.overrideAttrs (old: rec {
version = versions.bun;
Expand Down
Loading