Sfoglia il codice sorgente

fix potential format string pollution

Some URLs may have a format string pattern in them, which
will cause the argument count to be incorrect and crash
the enqueue. This locks in the key and URL to be plain
strings and completely uninterpreted to avoid this issue.
tags/v0.4.1
Chlod Alejandro 5 mesi fa
parent
commit
2e0199f652
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: A1E67C59037B0CC1
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. +4
    -3
      src/earwigbot/wiki/copyvios/workers.py

+ 4
- 3
src/earwigbot/wiki/copyvios/workers.py Vedi File

@@ -493,12 +493,13 @@ class CopyvioWorkspace:

key = ".".join(urlparse(url).netloc.split(".")[-2:])

logmsg = f"enqueue(): %s {key} -> {url}"
matchup = f"{key} -> {url}"
logmsg = f"enqueue(): %s %s"
if key in self._queues.sites:
self._logger.debug(logmsg % "append")
self._logger.debug(logmsg % ("append", matchup))
self._queues.sites[key].append(source)
else:
self._logger.debug(logmsg % "new")
self._logger.debug(logmsg % ("new", matchup))
q: SourceQueue = collections.deque()
q.append(source)
self._queues.sites[key] = q


Caricamento…
Annulla
Salva