Many minor uwt bugs

uwt has many minor bugs. Trivial to find with AI request.

  1. Time Privacy broken most days of year. Problem: date +%d and date +%m return zero-padded values like 09, which is_whole_number rejects.

POC:

faketime '2026-11-05 12:00:00' time_privacy; echo "exit $?"`
day is not a digit.

Broke on April 25 commit Bash arithmetic hardening · Whonix/uwt@7822489 · GitHub . Months 04, 05… 09 broken. Since no one reported for 6 months, no one is using it. Suggest removing Time Privacy from Whonix.

More omitted bugs with Time Privacy exist. In uwt other sections. Time Privacy removal will fix all. Maintaining unused code wastes maintainer effort.

  1. curl --next breaks stream isolation: uwt/usr/bin/curl.anondist:137-142 adds proxy lines, --next clears all args. Therefore, all non-first URLs lose stream isolation.

POC:

  curl https://a.example/ --next https://b.example/
  curl: (97) cannot complete SOCKS5 connection to a.example. (4)
  curl: (6) Could not resolve host: b.example
  zsh: exit 6     curl https://a.example/ --next https://b.example/

First is Tor error, second is curl attempting to look b.example itself.

  1. curl -q ignored. https://www.man7.org/linux/man-pages/man1/curl.1.html
    -q, --disable
    If used as the first parameter on the command line, the
    curlrc config file is not read or used. See the -K,
    –config for details on the default config file search
    path.
    uwt prepended proxy command stops -q from working. No longer first parameter.

Other raw findings do not seem worthy to fix. (Possibly number 4 worthy.) Did not verify or check. Raw AI outputs:

  3. argv[0] leak (uwtwrapper:245, uwtexec:47)
     - Problem: uwtwrapper_zeroarg is exported and inherited, so a wrapped program started by another one gets the parent's name as argv[0]. Verified: when git runs ssh with ProxyJump, ssh runs /usr/bin/git as the jump command.
     - Fix: in uwtexec, copy the values, unset uwtwrapper_zeroarg uwtwrapper_parent uwtwrapper_counter, then exec. Tested: the git-upload-pack symlink route still works with it.

  4. Per-application enable does not override global disable — retained configuration bug.
     uwtwrapper_global="0" together with uwtwrapper["/usr/bin/wget"]="1" leaves wget unwrapped, contradicting the configuration’s documented precedence. Reproduced with actual wget traffic. shared wrapper (uwt/usr/libexec/uwt/uwtwrapper:397)

  5. curl http://localhost/_ fails with error 97 (curl.anondist:85-86)
     - Problem: only 127.0.0.1 and [::1] count as loopback, so localhost is sent to Tor, which refuses it.
     - Fix: treat localhost and 127.0.0.0/8 as loopback too.

  6. The curl wrapper drops the proxy even with Tor up (curl.anondist:118)
     - Problem: the Tor check runs plain curl with the user's .curlrc and environment. Settings such as fail in .curlrc make the check fail, and the wrapper then runs without the proxy.
     - Fix: run the check with -q and a timeout, and fail instead of running unproxied. That also fixes known issue #4.

  8. ssh ConnectTimeout is ignored
     - Problem: torsocks does the whole Tor handshake inside connect(). Unwrapped ssh gave up after 3.0 s; wrapped ssh was still hanging at 25 s. wget's timeout works.
     - Fix: the real fix is in torsocks. uwt could use a ProxyCommand for ssh instead.
  9. Per-app Time Privacy writes to a literal ~ directory (uwtwrapper:386; only when Time Privacy is on)
     - Problem: the tilde is quoted, so it isn't expanded, and SCRIPTNAME_CLEANED is never set. The state lands in ./~/.timeprivacy/ under whatever directory the command runs in. Cleaning that up with rm -r ~ would delete the home directory.
     - Fix: use "${HOME}/.timeprivacy/<name>" and set the name variable.

Not necessarily true, not all users are present on the forums. Fixing this sounds easy.

Potentially difficult to fix. Stream isolation in curl is useful, but curl’s command line syntax is very complicated, would require a full parser re-implementation to catch all edge cases, and there was no known way to implement stream isolation in curl without command line injection when this wrapper was written, as curl refuses to resolve .onion addresses. See:

That being said, it appears this might be doable with environment variables nowadays (maybe it’s always been possible?), so it might be an option to adjust the wrapper to use the environment instead. In the mean time, users with more complex requirements from curl can use curl.anondist-orig.

No report of breakage during total breakage for 6 months. Not github or forum or any other communication. Seems unlikely any users use it. You think there are?

Other findings (unverified) of short AI review showed 5 or 10 Time Privacy bugs of other parts of uwt. This caused my removal recommendation.

Non-curl bugs of previous post seem minor but not useless. Seems uwt has very high number of bugs. Likely most not worth fixing. Trivial to find with AI request. You can find many more yourself if needed.

Unsure, but no way to reliably know and the feature is likely low-effort to keep. If it was a substantial maintenance burden then removal might indeed make sense.

Definitely shouldn’t invent a full curl parser. Localhost vs uwt is long standing documented issue:


Environment variables hygiene makes sense.


Any tilde is indeed best replaced with home variable.


timeprivacy:

Implemented but never finished (documentation etc.).


  8. ssh ConnectTimeout is ignored
     - Problem: torsocks does the whole Tor handshake inside connect(). Unwrapped ssh gave up after 3.0 s; wrapped ssh was still hanging at 25 s. wget's timeout works.
     - Fix: the real fix is in torsocks. uwt could use a ProxyCommand for ssh instead.

An ssh_config.d configuration drop-in may be more appropriate nowadays.