POJIA破甲
地图 / urlapi: off-by-one in custom scheme validation skips last character

urlapi: off-by-one in custom scheme validation skips last character

内存破坏 / Off-by-one Error / #3598358

厂商
curl
严重程度
中危
赏金
—
弱点
Off-by-one Error
研究员
@otiscui
披露日期
2026-03-12
资产
https://github.com/curl/curl
CVE
—

该报告还没有中文解读。

原文摘录

摘自原文(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 所有

同类报告

1-byte heap buffer overflow in DNS resolverInternet Bug Bounty · 2021-08-27Mishandling of hackerone clear background checks resulting in disclosure of other hacker's informationHackerOne · 2021-08-05Subdomain Takeover due to unclaimed domain pointing to AWSGSA Bounty · 2019-08-26Exim off-by-one RCE vulnerabilityInternet Bug Bounty · 2019-09-26Off-by-One Buffer Overflow in SMB Path Handlercurl · 2025-11-15