Files
hammer/recipes/incoming-gnome/CVE-2026-6732-test.patch
T
sergioandClaude Opus 5 fd73295c94 gnome onda 3: las tres piezas de soporte de eds — libsecret, libxml2-shared, libuuid-shared
Leído el CMakeLists real de evolution-data-server 3.56.2, la frontera de la cima
son cuatro cosas, no una. Estas son tres; la cuarta (NSS) va aparte.

  libsecret 0.21.7  b3:b75607c6  CMakeLists:932 la mete en el pkg_check_modules
        (DATA_SERVER REQUIRED …) sin perilla, y libedataserver-1.2 es lo que
        gnome-shell enlaza. En gcr se la había esquivado con -Dssh_agent=false;
        acá no hay cómo: eds guarda ahí las credenciales de correo y calendario.
        -Dcrypto=libgcrypt de las tres del combo — gnutls no existe en el corpus
        y 'disabled' apagaría el cifrado justo en la pieza que guarda contraseñas.

  libxml2-shared    b3:87389636  en libical la libxml2 sólo la enlazaba un binario
        de build y bastó la .a canónica; en eds entra en cuatro .so reales
        (CMakeLists:932,936,937,938) y la .a no es PIC. Mismos patches de CVE que
        la canónica: la superficie de seguridad no diverge.

  libuuid-shared    b3:d42cf850  `uuid` es REQUERIDA (:424). No es un
        "util-linux-shared": --disable-all-programs apaga los ~100 binarios y deja
        una sola librería. Duplicar la lista de --without-* del canónico para
        conseguir un .so de 30 KB sería mantener esa superficie en dos lugares.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 20:04:14 -04:00

85 lines
2.5 KiB
Diff

--- a/testparser.c
+++ b/testparser.c
@@ -11,6 +11,7 @@
#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <libxml/HTMLparser.h>
+#include <libxml/xmlschemas.h>
#include <string.h>
@@ -777,6 +778,63 @@
}
#endif /* WIN32 */
+#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
+/*
+ * Regression test for CVE-2026-6732: a type confusion in xmlParseReference
+ * crashed a schema-validating xmlTextReader whenever the document expanded
+ * an internal entity. Without the fix this triggers SIGSEGV on the first
+ * read; with the fix the entity expansion is read and the schema correctly
+ * reports the substituted content as invalid against xs:integer.
+ *
+ * Backport of upstream commit 7cea3fd1 adapted for the libxml2 2.13
+ * testparser.c layout (which predates the testReaderSchemaResourceLoader
+ * helper that upstream uses as an anchor on master).
+ */
+static int
+testReaderSchemaEntityExpansion(void) {
+ static const char xsd[] =
+ "<?xml version='1.0'?>\n"
+ "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>\n"
+ " <xs:element name='e' type='xs:integer'/>\n"
+ "</xs:schema>\n";
+ static const char xml[] =
+ "<!DOCTYPE e [<!ENTITY n \"not-an-int\">]>\n"
+ "<e>&n;</e>";
+ xmlSchemaParserCtxtPtr spc;
+ xmlSchemaPtr schema;
+ xmlTextReaderPtr reader;
+ int err = 0;
+ int ret;
+
+ spc = xmlSchemaNewMemParserCtxt(xsd, (int) sizeof(xsd) - 1);
+ schema = xmlSchemaParse(spc);
+ xmlSchemaFreeParserCtxt(spc);
+ if (schema == NULL) {
+ fprintf(stderr, "xmlSchemaParse failed\n");
+ return 1;
+ }
+
+ reader = xmlReaderForMemory(xml, (int) sizeof(xml) - 1, "doc.xml", NULL,
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+ xmlTextReaderSetSchema(reader, schema);
+
+ while ((ret = xmlTextReaderRead(reader)) == 1)
+ ;
+ if (ret != 0) {
+ fprintf(stderr, "reader failed on entity-expanded document\n");
+ err = 1;
+ }
+ if (xmlTextReaderIsValid(reader) != 0) {
+ fprintf(stderr, "schema missed invalid entity-expanded text\n");
+ err = 1;
+ }
+
+ xmlFreeTextReader(reader);
+ xmlSchemaFree(schema);
+ return err;
+}
+#endif
+
int
main(void) {
int err = 0;
@@ -807,6 +865,9 @@
#ifdef LIBXML_XINCLUDE_ENABLED
err |= testReaderXIncludeError();
#endif
+#ifdef LIBXML_SCHEMAS_ENABLED
+ err |= testReaderSchemaEntityExpansion();
+#endif
#endif
#ifdef LIBXML_WRITER_ENABLED
err |= testWriterClose();