瀏覽代碼

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 月之前
父節點
當前提交
2e0199f652
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A1E67C59037B0CC1
共有 1 個檔案被更改,包括 4 行新增 和 3 行删除
  1. +4
    -3
      src/earwigbot/wiki/copyvios/workers.py

+ 4
- 3
src/earwigbot/wiki/copyvios/workers.py 查看文件

@@ -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


Loading…
取消
儲存