Sfoglia il codice sorgente

SimplePie: Fix regex in clean_hash() (#9616)

fix https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-8pj8-6xgr-8r8f
And there was also a bug for PHP < 8.4, which does not recognise the regex quantifier `{,8192}` but only `{0,8192}`
Alexandre Alapetite 1 giorno fa
parent
commit
a3d8ce7aab
2 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 1 1
      lib/composer.json
  2. 3 1
      lib/simplepie/simplepie/src/SimplePie.php

+ 1 - 1
lib/composer.json

@@ -22,7 +22,7 @@
 		"marienfressinaud/lib_opml": "dev-main#f0e850b6394af90b898daf0e65fcc7363457b844",
 		"phpgt/cssxpath": "dev-master#9d416ccddb048aebd92724c4f8e92f88e3bfc412",
 		"phpmailer/phpmailer": "7.1.1",
-		"simplepie/simplepie": "dev-freshrss#d7467dd6a5e59cc6f4c73d0e8d5cadc5e7c9ecfc"
+		"simplepie/simplepie": "dev-freshrss#1bfb15fbbdf6488b78253f76433c9268404eb3d3"
 	},
 	"config": {
 		"sort-packages": true,

+ 3 - 1
lib/simplepie/simplepie/src/SimplePie.php

@@ -1778,7 +1778,9 @@ class SimplePie
                         [
                             '#<(lastBuildDate|pubDate|updated|feedDate|dc:date|slash:comments)>[^<]+</\\1>#',
                             '#<(media:starRating|media:statistics) [^/<>]+/>#',
-                            '#<!--.{,8192}?(-->|(?=]]>))#s', // XML comments up to a max length and stops at apparent end of CDATA section
+                            // XML comments up to a max length and stops at apparent end of CDATA section,
+                            // or at the start of another comment (unless part of an end such as `<!-->`)
+                            '#<!--.{0,8192}?(-->|(?=]]>|<!--(?!-*>)))#s',
                         ],
                         '',
                         $stream_data