-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Mishandling of json configuration file could lead to Null Pointer Dereference #1739
Copy link
Copy link
Closed
Description
What version of shadowsocks-libev are you using?
shadowsocks-libev-3.1.0
What operating system are you using?
Ubuntu 16.04 64 bit
What did you do?
In parsing json configuration file, two of the properties ("mode", "plugin") do not perform null checking before invoking strlen,
Lines 248 to 253 in c67d275
| } else if (strcmp(name, "plugin") == 0) { | |
| conf.plugin = to_string(value); | |
| if (strlen(conf.plugin) == 0) { | |
| ss_free(conf.plugin); | |
| conf.plugin = NULL; | |
| } |
feeding null json value to "mode" or "plugin" property will trigger process crash.
PoC:
(py3) ➜ src ./ss-server -c config.json
[1] 28610 segmentation fault (core dumped) ./ss-server -c config.json
(py3) ➜ src cat config.json
{
"server":"my_server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"plugin": null
}
What did you expect to see?
What did you see instead?
What is your config in detail (with all sensitive info masked)?
Regards,
Alex, SourceBrella Inc.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels