urlapi: off-by-one in custom scheme validation skips last character
内存破坏 / Off-by-one Error / #3598358
该报告还没有中文解读。
原文摘录
摘自原文(3079 字符中的一小部分)
In `lib/urlapi.c`, the `set_url_scheme()` function has an off-by-one error when validating custom scheme names. The validation loop checks `scheme[0]` twice (once by `ISALPHA`, once in the loop) and never checks the last character. This allows schemes ending with any arbitrary byte (e.g., `foo!`, …
原文中的代码
#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURLU *url;
CURLUcode rc;
const char *schemes[] = {"bad!", "bad{", "bad/", "bad\\", "a!", NULL};
for(int i = 0; schemes[i]; i++) {
url = curl_url();
rc = curl_url_set(url, CURLUPART_SCHEME, schemes[i], …默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 curl 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @otiscui · 版权归作者与 curl 所有