Changeset 3775297
- Timestamp:
- 10/30/2026 01:01:23 PM (25 hours ago)
- Location:
- iubenda-cookie-law-solution/tags/beta
- Files:
-
- 2 edited
-
iubenda-cookie-class/simple_html_dom.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iubenda-cookie-law-solution/tags/beta/iubenda-cookie-class/simple_html_dom.php
r3773736 r3775297 1674 1674 $rand = md5( uniqid( (string) mt_rand(), true ) ); 1675 1675 } 1676 $this->noise_prefix = '___noise___' . $rand . '_'; 1676 // Trailing space is deliberate: an attribute name stops at a space, so a 1677 // key can never be one and noise can never be restored into that position. 1678 $this->noise_prefix = '___noise___' . $rand . ' '; 1677 1679 $this->nodes = array(); 1678 1680 $this->lowercase = $lowercase; … … 2280 2282 $prefix = $this->noise_prefix; 2281 2283 $prefix_len = strlen($prefix); 2282 2283 while (($pos = strpos($text, $prefix)) !== false) { 2284 $offset = 0; 2285 2286 // The search offset only ever moves forward, so the loop is O(n) in the 2287 // length of $text and can never rescan a region it has already resolved. 2288 // It is the structural guarantee against the DoS: no branch below re-emits 2289 // the prefix, and every branch advances $offset past the token it saw. 2290 while (($pos = strpos($text, $prefix, $offset)) !== false) { 2284 2291 // A valid placeholder is the per-parse prefix followed by a 5-char 2285 2292 // numeric key. The prefix carries a random, per-parse component, so … … 2315 2322 . $restored 2316 2323 . substr($text, $pos + $prefix_len + 5); 2324 2325 // Resume the search at the start of the just-restored body so a 2326 // placeholder nested inside it (e.g. a comment stashed inside a 2327 // <script> body) is still expanded. The noise table is finite 2328 // and each pass resolves one entry, so this still terminates. 2329 $offset = $pos; 2317 2330 } else { 2318 // Unknown key: consume the whole token so the loop always 2319 // advances and never re-emits the prefix. Re-emitting it let 2320 // strpos() match it again on the next pass and spin forever 2321 // while growing the string (an unauthenticated DoS). 2322 $text = substr($text, 0, $pos) 2323 . substr($text, $pos + $prefix_len + 5); 2331 // Unknown key: never re-emit the prefix (that is what let the 2332 // old guard spin forever). Leave the original bytes in place and 2333 // step the offset past this occurrence, so content is preserved 2334 // rather than silently deleted and the loop still advances. 2335 $offset = $pos + $prefix_len + 5; 2324 2336 } 2325 2337 } else { 2326 // Truncated token at the end of the string: drop just the prefix 2327 // occurrence so the loop terminates. 2328 $text = substr($text, 0, $pos) 2329 . substr($text, $pos + $prefix_len); 2338 // Truncated token at the end of the string: leave the bytes and 2339 // step past the prefix so the loop terminates without eating them. 2340 $offset = $pos + $prefix_len; 2330 2341 } 2331 2342 } -
iubenda-cookie-law-solution/tags/beta/readme.txt
r3773736 r3775297 271 271 * Improved: Cookie-block markers are now stripped from visitor comments, so comment content is never re-processed by the Native Blocking parser 272 272 * Fixed: A malformed cookie-block marker could stall page rendering 273 * Credit: Reported by Jakub Herman273 * Credit: Reported independently by Jakub Herman (via WPScan), via Wordfence, and by Dthangws (via Patchstack) 274 274 275 275 = 3.13.6 =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)