Off-by-One Buffer Overflow in SMB Path Handler
内存破坏 / Off-by-one Error / #3427343
该报告还没有中文解读。
原文摘录
摘自原文(2101 字符中的一小部分)
Found an off-by-one buffer overflow in `lib/smb.c` when handling SMB file paths. The bounds check uses `>` instead of `>=`, allowing a path of exactly 1023 bytes to overflow the 1024-byte buffer by one byte when the null terminator is added.
原文中的代码
struct smb_nt_create {
// ... other fields ...
char bytes[1024]; // fixed size buffer
} PACK;
static CURLcode smb_send_open(...) {
struct smb_nt_create msg;
const size_t byte_count = strlen(req->path) + 1;
if(byte_count > sizeof(msg.bytes)) // Wrong: should be >= …默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 curl 所有。
时间线
- 报告提交
- 公开披露
阅读 HackerOne 原文 ↗作者 @pelioro · 版权归作者与 curl 所有