Repository navigation
tornion 1.0.1 — security patch
🔒 Security patch. Following a static review pass, two real holes were closed.
Fixed
-
detect_running_tor()now actually verifies the SOCKS5 server is Tor. The previous probe accepted any SOCKS5-speaking endpoint, which would have lettornionsilently route privacy-sensitive traffic through a non-Tor proxy (e.g. proxychains, dante,ssh -D) running on the default Tor ports. The probe now performs Tor'sRESOLVEprotocol extension (SOCKS5 command byte0xF0); plain SOCKS5 servers reply withREP=0x07("Command not supported") and are rejected. -
Hardened tar extraction for Python 3.9–3.11.
install_tor()previously fell back to baretarfile.extractall()when thefilter="data"argument (3.12+) wasn't available, leaving a path-traversal window open if a malicious archive ever defeated the SHA-256 pin. New_safe_extract_tar()validates every member — rejects symlinks, hardlinks, devices, FIFOs, absolute paths, and any path that resolves outside the target directory — before callingextractall.
Changed
- Reusing an externally-managed tor (
use_existing=True, default) now logs aWARNINGinstead ofINFO, telling the user explicitly thattorniondid not start tor itself and pointing atuse_existing=Falsefor full management. - Per-HS
tor-datacache subdirectory usessha256(key_dir)[:16]instead of the builtinhash()(which is salted byPYTHONHASHSEEDand produced a different name on every Python process, accumulating orphan cache directories). The on-disk.onionidentity itself was never affected.
Internal
- Docstring example for
server.serve()corrected to the documentedfrom tornion import serverform. - Static "tests 21 passed" badge removed from the README (misleading — count had drifted).
- README "Roadmap to 1.0" section renamed to "Roadmap" now that 1.0 has shipped.
Tests
34 unit tests + 1 e2e integration test (was 30 + 1). The 4 new ones guard against regression of the SOCKS5/RESOLVE probe and the tar extraction safety.
Upgrade
pip install --upgrade tornion
1.0.0 is being yanked from PyPI in favor of this release — existing installs continue to work, but new pip install tornion will skip it.