-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Potential access violation / buffer overflow condition #1626
Copy link
Copy link
Closed
Labels
Description
What version of shadowsocks-libev are you using?
v3.0.8
What operating system are you using?
Arch Linux
What did you do?
Nothing but inspecting.
What did you expect to see?
Everything works like a charm.
What did you see instead?
It seems that at
Line 163 in 7c5416b
| long pos = ftell(f); |
ftell to get file pointer position, and in this condition Line 170 in 7c5416b
| buf = ss_malloc(pos + 1); |
buf is directly used at Line 175 in 7c5416b
| int nread = fread(buf, pos, 1, f); |
Moreover, according to our test cases, OS can accept this type of address written but in this condition pos is a size_t so it is max possible integer. So this is already an exploitable buffer overflow. If this condition passed, we will also see a buffer underflow at
Line 181 in 7c5416b
| buf[pos] = '\0'; // end of string |
What is your config in detail (with all sensitive info masked)?
Reactions are currently unavailable