socks: Make SafeSocks refuse SOCKS4 and accept SOCKS4a

The logic was inverted. Introduced in commit
9155e08450.

This was reported through our bug bounty program on H1. It fixes the
TROVE-2022-002.

Fixes #40730

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet
2022-12-12 10:02:07 -05:00
parent b117ce48db
commit a282145b36
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ static socks_result_t
process_socks4_request(const socks_request_t *req, int is_socks4a,
int log_sockstype, int safe_socks)
{
if (is_socks4a && !addressmap_have_mapping(req->address, 0)) {
if (!is_socks4a && !addressmap_have_mapping(req->address, 0)) {
log_unsafe_socks_warning(4, req->address, req->port, safe_socks);
if (safe_socks)