Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sslocal): disallow HTTP/SOCKS4 proxying when authentication required #1765

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

alaz
Copy link
Contributor

@alaz alaz commented Nov 11, 2024

Testing

The same set of tests as in #1764

config.json

{
    "locals": [
        {
            "protocol": "socks",
            "local_address": "127.0.0.1",
            "local_port": 9090,
            "socks5_auth_config_path": "auth.json"
        }
    ],

    "servers": [
            {...}
    ],
}

auth.json:

{
    "password": {
        "users": [
            {
                "user_name": "user",
                "password": "password"
            }
        ]
    }
}

Tests:

$ curl -si --proxy socks5://127.0.0.1:9090 -U user:password https://api.seeip.org | head -4
HTTP/1.1 200 OK
Server: nginx/1.18.0 (Ubuntu)
Date: Mon, 11 Nov 2024 17:38:29 GMT
Content-Type: text/plain
$ curl -i --proxy socks5://127.0.0.1:9090 -U user:pass https://api.seeip.org 
curl: (97) User was rejected by the SOCKS5 server (1 255).
$ curl -i --proxy http://127.0.0.1:9090 -U us:pass https://api.seeip.org 
curl: (56) Recv failure: Connection reset by peer

@alaz alaz force-pushed the fix-auth-protocols branch from 74d712b to f4c5d95 Compare November 11, 2024 17:36
@zonyitoo zonyitoo merged commit 82681fa into shadowsocks:master Nov 12, 2024
10 of 11 checks passed
@alaz alaz deleted the fix-auth-protocols branch November 12, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants