Repository navigation
Fix findings from the security audit - #3083
Merged
Merged
Conversation
Remote: - TCP: handshake/connect deadlines follow --timeout instead of a 24h minimum, so idle sockets can no longer fill the connection pool. - ACL: IPv4-mapped IPv6 addresses are matched against the IPv4 lists. - UDP server now enforces the peer ACL and the outbound block list. - ACL loading fails closed on bad files or invalid entries. - TCP half-close is relayed instead of tearing the connection down. - AEAD-2022 UDP sessions are created only after timestamp/replay checks. ss-manager: - Owner-only conf files (deleted on remove), 0600 control socket, umask 022, safe working directory, loopback-only IP addresses, per-user sender check on Linux, plugins only over the UNIX socket. - Port canonicalisation, list() overflow, add/remove waits for the server, stale pid files can't signal unrelated processes. Also: plugins drop to --user, daemonize readiness/pid file handling, resolver cancellation, replay-filter fail-closed, key wiping, spec strictness in AEAD/2022 parsing, JSON surrogate validation, ss:// plugin name checks, embedding API state reset, Android protect_socket replies. Adds tests/test_server_acl.py and tests/test_half_close.py and extends the manager, ACL, AEAD-2022 and ssurl tests. Co-Authored-By: Claude <noreply@anthropic.com>
- Define _GLIBCXX_NO_ASSERTIONS: libstdc++ 15 enables assertions at -O0, which pulls __glibcxx_assert_fail (C++ runtime) into the programs. - test_redir_qemu: boot the guest with -cpu max so the runner's glibc loader runs under TCG. - find_program: std::string_view PATH splitting into a fixed buffer, no heap and no null snprintf destination (GCC -Wformat-truncation). - manager: parse /proc/net/udp numbers with strtoul (cert-err34-c); walk /proc/<pid>/cmdline with std::string_view. - ssurl: sanitise the tag through std::span. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…nores inconsistent gcov 15 marks the lambda as not hit while its lines are, which lcov 2 rejects. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes every finding from a full audit of the codebase: TCP and UDP relays, the resolver, crypto, the program mains and ACL, and the manager, config and plugin code.
Remotely reachable
--max-connectionsidle sockets could lock the server out. Handshake and connect deadlines now follow--timeout.::ffff:127.0.0.1skipped IPv4 rules for both the outbound block list and the peer ACL.shutdown(SHUT_WR)from one side is passed on, and the other direction keeps flowing.ss-manager
remove. The control socket is 0600,daemonizeuses umask 022, and an unsafe working directory is refused.-auser. A per-serverpluginis accepted only over the UNIX socket.0080=80), the off-by-one inlistis fixed,addandremovewait for the server, and stale pid files can no longer signal unrelated processes.Other
--useruser. On Linux they keepCAP_NET_BIND_SERVICE.daemonize: the start succeeds only once the daemon is serving, and the pid file is opened safely.\u0000is rejected. NULL holes inport_passwordandserverare fixed. Thess://plugin=value must be a plain program name.protect_socketnow handles failure replies.Behaviour changes for operators
--timeout(default 60 s) instead of 24 h.--useruser.Tests
tests/test_server_acl.pyandtests/test_half_close.py(registered with CTest).🤖 Generated with Claude Code