18ef8e
diff -up thunderbird-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236 thunderbird-91.7.0/parser/expat/lib/xmlparse.c
18ef8e
--- thunderbird-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236	2022-03-02 18:08:40.085642028 +0100
18ef8e
+++ thunderbird-91.7.0/parser/expat/lib/xmlparse.c	2022-03-02 18:13:31.838667958 +0100
18ef8e
@@ -700,8 +700,7 @@ XML_ParserCreate(const XML_Char *encodin
18ef8e
 XML_Parser XMLCALL
18ef8e
 XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
18ef8e
 {
18ef8e
-  XML_Char tmp[2];
18ef8e
-  *tmp = nsSep;
18ef8e
+  XML_Char tmp[2] = {nsSep, 0};
18ef8e
   return XML_ParserCreate_MM(encodingName, NULL, tmp);
18ef8e
 }
18ef8e
 #endif
18ef8e
@@ -1276,8 +1275,7 @@ XML_ExternalEntityParserCreate(XML_Parse
18ef8e
      would be otherwise.
18ef8e
   */
18ef8e
   if (ns) {
18ef8e
-    XML_Char tmp[2];
18ef8e
-    *tmp = namespaceSeparator;
18ef8e
+    XML_Char tmp[2] = {parser->m_namespaceSeparator, 0};
18ef8e
     parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
18ef8e
   }
18ef8e
   else {
18ef8e
@@ -3667,6 +3665,16 @@ addBinding(XML_Parser parser, PREFIX *pr
18ef8e
     if (!mustBeXML && isXMLNS
18ef8e
         && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
18ef8e
       isXMLNS = XML_FALSE;
18ef8e
+    // NOTE: While Expat does not validate namespace URIs against RFC 3986,
18ef8e
+    //       we have to at least make sure that the XML processor on top of
18ef8e
+    //       Expat (that is splitting tag names by namespace separator into
18ef8e
+    //       2- or 3-tuples (uri-local or uri-local-prefix)) cannot be confused
18ef8e
+    //       by an attacker putting additional namespace separator characters
18ef8e
+    //       into namespace declarations.  That would be ambiguous and not to
18ef8e
+    //       be expected.
18ef8e
+    if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)) {
18ef8e
+      return XML_ERROR_SYNTAX;
18ef8e
+    }
18ef8e
   }
18ef8e
   isXML = isXML && len == xmlLen;
18ef8e
   isXMLNS = isXMLNS && len == xmlnsLen;