Translation discovery crashes on crafted filenames (regex substitution injection)
代码执行 / Use of Externally-Controlled Format String / #4044441
该报告还没有中文解读。
原文摘录
摘自原文(4587 字符中的一小部分)
The `translation-finder` package (used by Weblate for translation file discovery) raises an uncaught `re.error` and aborts discovery for the whole repository when a scanned repository contains a translation file whose name embeds backslash-escaped language tokens, e.g. `x\g<99>-en.po` or …
原文中的代码
wildcard = self.get_wildcard(part)
if wildcard:
mask_parts = parts.copy()
match = re.compile(f"(^|[._-]){re.escape(part)}($|[._-])")
for i, current in enumerate(mask_parts):
if match.findall(current):
skip.add(i)
mask_parts[i] = match.sub( …默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 Weblate 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @sumit-sabhaya · 版权归作者与 Weblate 所有