Procházet zdrojové kódy

Preventive measure against search ingestion (#8777)

We were not vulnerable to it, but here is an additional layer of security against search ingestions, in particular in public user queries, where someone could try to ingest a search like `) OR (interesting`
Alexandre Alapetite před 2 týdny
rodič
revize
a1c637e7ac
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      app/Models/BooleanSearch.php

+ 2 - 0
app/Models/BooleanSearch.php

@@ -24,6 +24,8 @@ class FreshRSS_BooleanSearch implements \Stringable {
 		bool $expandUserQueries = true
 	) {
 		$input = trim($input);
+		$input = ltrim($input, ' )');
+		$input = rtrim($input, ' (\\');
 		if ($input === '') {
 			return;
 		}