Compare commits

..

4 Commits

Author SHA1 Message Date
Vladimir Dubrovin
122ca26249 Fix windows build, re-submit as 0.9.8
Some checks are pending
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run
2026-08-07 19:16:00 +03:00
Vladimir Dubrovin
6369fe966e fix rh spec file for imapp 2026-08-07 18:00:43 +03:00
Vladimir Dubrovin
cb27ca5223 Commit as 0.9.8 2026-08-07 17:45:37 +03:00
Vladimir Dubrovin
932c4e3fd9 Fix use-after-free on ftp:// request path in proxychild()
ss pointed into the buf request buffer and was never updated when buf
was realloc()ed while reading request headers (both in the header loop
and in handlehdrfilterscli()). The ftp:// branch then dereferenced the
stale pointer.

Store ss as an offset into buf and recompute it before use.

Requires authenticated access to proxy or configuration with
authentication disabled.

Reported by Calif.io in collaboration with Anthropic
(ref ANT-2026-FHVKZ7VQ).
2026-08-07 16:36:51 +03:00
14 changed files with 102 additions and 55 deletions

View File

@ -39,5 +39,5 @@ jobs:
cd "D:/a/3proxy/3proxy"
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib;c:/vcpkg/installed/x64-windows/lib"
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include;c:/vcpkg/installed/x64-windows/include"
nmake /F Makefile.msvc WOLFSSL=1
nmake /F Makefile.msvc WOLFSSL=1 || exit /b 1
nmake /F Makefile.msvc clean

1
.gitignore vendored
View File

@ -272,3 +272,4 @@ bin/3proxy_tlspr
bin/3proxy_udppm
build*/*
testcerts/
/.claude

View File

@ -1,25 +1,28 @@
3proxy-0.9.7 Released July, 4 2026
3proxy-0.9.8 Released August, 7 2026
+ PCRE2 and SSL/TLS code moved from plugins into main 3proxy binary; dynamic linking with ssl/pcre by default, STATIC/LIBSTATIC options for static linking
+ Unix sockets support for parent proxies, tcppm, internal listeners and -i option; abstract (fileless) unix sockets on Linux
+ ssl_client_mode = 3 to use 'secure' parent types: https, tcps, socks5s, connect+s, etc.
+ New authcache types: cacheacl, dstaddr, dstport, dsthost, dstoper, srvaddr, srvport; authcache is now configurable per service
+ Hashtables for password lists and authcache, faster password lookups
+ 3proxy_crypt: new internal password hashing replacing mycrypt
+ udppm switched to hashtables and supports multiple connections
+ SOCKSv5 UDP parent support; -Ne/-Ni NAT options
+ Docker images for more platforms, signed; DLLs signed; public cert added to build
+ Grace sleep and linger on connection close; correctly process half-closed connections
+ Allow setting internal/external network namespaces on Linux
- icqpr/OSCAR code removed
! Fix: invalid error in SSL server handshake could break service state
! Fix: invalid offset in datafilters
! Fix: invalid socket in poll() could break sockmap() on Windows
! Fix: deadlock in ftppr
! Fix: crash on standalone services
! Fix: non-initialized mutex crash under Windows
! Fix: socks v5 parent with no auth
! Fix: hanging connections in sockmap; unneeded poll in sockmap
! Fix: symbols collision with OpenSSL could lead to crash
! Fix: compatibility with older SSL versions and older Windows (7 and below)
!! Fix: use-after-free on the ftp:// request path in HTTP proxy, a request buffer reallocation left a stale pointer; heap corruption, requires authenticated access
!! Fix: buffer overflow in radsend() with an oversized request hostname; RADIUS is experimental, log radius or auth radius with fakeresolve is required to reach it
!! Fix: buffer overflow in smtpp when relaying AUTH LOGIN credentials to a server which offers AUTH PLAIN only; requires authorised access to smtpp
!! Fix: out-of-bounds read in tlspr on a malformed TLS ClientHello
!! Fix: LDAP injection and unsafe counter file names in LdapPlugin; the plugin is unsupported and is not built with 3proxy
!! Fix: password and hash comparison in strong authentication is constant-time now
!! Fix: bounds validation and match/depth limits in pcre filters
+ imapp: IMAPv4 proxy added, supports LOGIN command, AUTH PLAIN and AUTH LOGIN
+ STARTTLS support for smtpp, pop3p, imapp and tlspr, on both client and server side; -x option to disable
+ wolfSSL is supported as an alternative TLS backend, WOLFSSL_CHECK=true selects it (wolfSSL must be built with --enable-opensslextra)
+ Chunked Transfer-Encoding from client is supported by HTTP proxy
+ dnspr: -F option added, fake resolve to redirect traffic
+ ucrt64 build support; static libraries support in Makefile.win
+ minimal and busybox Docker images switched to musl + wolfSSL
- splice() support is not built by default anymore, it is slower than the read/write path for most traffic; add -DWITHSPLICE to build it
! Fix: hashtable item was added with wrong index on table grow; with large username/password tables it could cause a single record to be missing
! Fix: race conditions; stack overflow on FreeBSD
! Fix: generated certificates are X.509 v3 with basicConstraints CA:FALSE and extendedKeyUsage serverAuth, required by Apple TLS stack and by Chrome on macOS/iOS
! Fix: dnspr was broken since udppm rewrite
! Fix: short cleartext passwords failed authentication
! Fix: parent negotiation after sending PROXY protocol header
! Fix: maxchild dropped to 100 on config reload if not set explicitly
! Fix: getrandom() is not used with glibc below 2.25
! Fix: IPV6_BOUND_IF definition for legacy MacOS
! Fix: cmake build, arm64 Docker build, Makefile.win with UCRT
! Multiple minor bugfixes and code cleanup

View File

@ -1,25 +1,28 @@
3proxy-0.9.7 Вышел 4 Июля 2026
3proxy-0.9.8 Вышел 7 Августа 2026
+ Код PCRE2 и SSL/TLS перенесён из плагинов в основной бинарный файл 3proxy; по умолчанию динамическое связывание с ssl/pcre, опции STATIC/LIBSTATIC для статического связывания
+ Поддержка unix-сокетов для родительских прокси, tcppm, внутренних слушателей и опции -i; абстрактные (безфайловые) unix-сокеты в Linux
+ ssl_client_mode = 3 для использования «безопасных» типов родителя: https, tcps, socks5s, connect+s и т.д.
+ Новые типы authcache: cacheacl, dstaddr, dstport, dsthost, dstoper, srvaddr, srvport; authcache настраивается для каждого сервиса
+ Хеш-таблицы для списков паролей и authcache, более быстрый поиск паролей
+ 3proxy_crypt: новое внутреннее хеширование паролей, заменяющее mycrypt
+ udppm переведён на хеш-таблицы и поддерживает множество соединений
+ Поддержка UDP-родителя для SOCKSv5; опции NAT -Ne/-Ni
+ Docker-образы для большего числа платформ, подписанные; подписанные DLL; публичный сертификат добавлен в сборку
+ Grace sleep и linger при закрытии соединения; корректная обработка полузакрытых соединений
+ Разрешено задавать внутренние/внешние сетевые пространства имён (network namespaces) в Linux
- Код icqpr/OSCAR удалён
! Исправление: некорректная ошибка в SSL server handshake могла ломать состояние сервиса
! Исправление: некорректное смещение в datafilters
! Исправление: некорректный сокет в poll() мог ломать sockmap() в Windows
! Исправление: взаимоблокировка (deadlock) в ftppr
! Исправление: падение на standalone-сервисах
! Исправление: падение из-за неинициализированного mutex в Windows
! Исправление: родитель socks v5 без аутентификации
! Исправление: зависающие соединения в sockmap; лишний poll в sockmap
! Исправление: конфликт символов с OpenSSL мог приводить к падению
! Исправление: совместимость со старыми версиями SSL и старыми версиями Windows (7 и ниже)
!! Исправление: use-after-free на пути обработки запроса ftp:// в HTTP-прокси, перевыделение буфера запроса оставляло устаревший указатель; повреждение кучи, требуется аутентифицированный доступ
!! Исправление: переполнение буфера в radsend() при слишком длинном имени хоста в запросе; RADIUS является экспериментальным, для достижения кода необходимы log radius или auth radius в сочетании с fakeresolve
!! Исправление: переполнение буфера в smtpp при передаче учётных данных AUTH LOGIN серверу, поддерживающему только AUTH PLAIN; требуется авторизованный доступ к smtpp
!! Исправление: чтение за границами буфера в tlspr при некорректном TLS ClientHello
!! Исправление: LDAP-инъекция и небезопасные имена файлов счётчиков в LdapPlugin; плагин не поддерживается и не собирается вместе с 3proxy
!! Исправление: сравнение паролей и хешей в strong-аутентификации теперь выполняется за постоянное время
!! Исправление: проверка границ и ограничения match/depth в pcre-фильтрах
+ imapp: добавлен IMAPv4-прокси, поддерживаются команда LOGIN, AUTH PLAIN и AUTH LOGIN
+ Поддержка STARTTLS для smtpp, pop3p, imapp и tlspr, как со стороны клиента, так и со стороны сервера; опция -x для отключения
+ wolfSSL поддерживается как альтернативный TLS-бэкенд, выбирается через WOLFSSL_CHECK=true (wolfSSL должен быть собран с --enable-opensslextra)
+ HTTP-прокси поддерживает Transfer-Encoding: chunked от клиента
+ dnspr: добавлена опция -F, фиктивное разрешение имён для перенаправления трафика
+ Поддержка сборки ucrt64; поддержка статических библиотек в Makefile.win
+ Docker-образы minimal и busybox переведены на musl + wolfSSL
- Поддержка splice() больше не собирается по умолчанию, она медленнее пути read/write для большинства видов трафика; для сборки добавьте -DWITHSPLICE
! Исправление: элемент хеш-таблицы добавлялся с неверным индексом при росте таблицы; на больших таблицах пользователей/паролей это могло приводить к отсутствию одной записи
! Исправление: состояния гонки; переполнение стека во FreeBSD
! Исправление: генерируемые сертификаты имеют формат X.509 v3 с basicConstraints CA:FALSE и extendedKeyUsage serverAuth, что требуется TLS-стеком Apple и Chrome в macOS/iOS
! Исправление: dnspr был сломан со времён переписывания udppm
! Исправление: короткие пароли в открытом виде не проходили аутентификацию
! Исправление: согласование с родителем после отправки заголовка PROXY protocol
! Исправление: maxchild сбрасывался в 100 при перезагрузке конфигурации, если не задан явно
! Исправление: getrandom() не используется с glibc ниже 2.25
! Исправление: определение IPV6_BOUND_IF для устаревших версий MacOS
! Исправление: сборка cmake, сборка Docker для arm64, Makefile.win с UCRT
! Множество мелких исправлений и очистка кода

View File

@ -29,7 +29,7 @@ RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
cd /src && \
autoreconf -i && \
./configure --enable-opensslextra --enable-opensslall --enable-certgen \
./configure --enable-opensslextra --enable-certgen \
--enable-tls13 --enable-sni --enable-session-ticket \
--enable-static --disable-shared --prefix=/usr/local && \
make -j$(nproc) && make install

View File

@ -35,7 +35,7 @@ RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
cd /src && \
autoreconf -i && \
./configure --enable-opensslextra --enable-opensslall --enable-certgen \
./configure --enable-opensslextra --enable-certgen \
--enable-tls13 --enable-sni --enable-session-ticket \
--enable-static --disable-shared --prefix=/usr/local && \
make -j$(nproc) && make install

View File

@ -104,7 +104,7 @@ INSTALL_OBJS = bin/3proxy \
bin/$(CRYPT_PREFIX)crypt \
bin/$(PREFIX)ftppr \
bin/$(PREFIX)imapp \
bin/$(PREFIX)pop3p \
bin/$(PREFIX)pop3p \
bin/$(PREFIX)proxy \
bin/$(PREFIX)smtpp \
bin/$(PREFIX)socks \

View File

@ -1 +1 @@
0.9.7
0.9.8

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
3proxy (0.9.8-1) buster; urgency=medium
*3proxy 0.9.8 initial build
-- z3APA3A <3apa3a@3proxy.org> Fri, 07 Aug 2026 17:44:30 +0300
3proxy (0.9.7-1) buster; urgency=medium
*3proxy 0.9.7 initial build

26
doc/changelog/0/9/8 Normal file
View File

@ -0,0 +1,26 @@
!! Fix: use-after-free on the ftp:// request path in HTTP proxy, a request buffer reallocation left a stale pointer; heap corruption, requires authenticated access
!! Fix: buffer overflow in radsend() with an oversized request hostname; RADIUS is experimental, log radius or auth radius with fakeresolve is required to reach it
!! Fix: buffer overflow in smtpp when relaying AUTH LOGIN credentials to a server which offers AUTH PLAIN only; requires authorised access to smtpp
!! Fix: out-of-bounds read in tlspr on a malformed TLS ClientHello
!! Fix: LDAP injection and unsafe counter file names in LdapPlugin; the plugin is unsupported and is not built with 3proxy
!! Fix: password and hash comparison in strong authentication is constant-time now
!! Fix: bounds validation and match/depth limits in pcre filters
+ imapp: IMAPv4 proxy added, supports LOGIN command, AUTH PLAIN and AUTH LOGIN
+ STARTTLS support for smtpp, pop3p, imapp and tlspr, on both client and server side; -x option to disable
+ wolfSSL is supported as an alternative TLS backend, WOLFSSL_CHECK=true selects it (wolfSSL must be built with --enable-opensslextra)
+ Chunked Transfer-Encoding from client is supported by HTTP proxy
+ dnspr: -F option added, fake resolve to redirect traffic
+ ucrt64 build support; static libraries support in Makefile.win
+ minimal and busybox Docker images switched to musl + wolfSSL
- splice() support is not built by default anymore, it is slower than the read/write path for most traffic; add -DWITHSPLICE to build it
! Fix: hashtable item was added with wrong index on table grow; with large username/password tables it could cause a single record to be missing
! Fix: race conditions; stack overflow on FreeBSD
! Fix: generated certificates are X.509 v3 with basicConstraints CA:FALSE and extendedKeyUsage serverAuth, required by Apple TLS stack and by Chrome on macOS/iOS
! Fix: dnspr was broken since udppm rewrite
! Fix: short cleartext passwords failed authentication
! Fix: parent negotiation after sending PROXY protocol header
! Fix: maxchild dropped to 100 on config reload if not set explicitly
! Fix: getrandom() is not used with glibc below 2.25
! Fix: IPV6_BOUND_IF definition for legacy MacOS
! Fix: cmake build, arm64 Docker build, Makefile.win with UCRT
! Multiple minor bugfixes and code cleanup

View File

@ -1,5 +1,5 @@
Name: 3proxy
Version: 0.9.7
Version: 0.9.8
Release: 1%{?dist}
Summary: 3proxy tiny proxy server
License: GPL/LGPL/Apache/BSD
@ -34,6 +34,7 @@ make clean
/bin/3proxy
/bin/3proxy_crypt
/bin/3proxy_ftppr
/bin/3proxy_imapp
/bin/3proxy_pop3p
/bin/3proxy_proxy
/bin/3proxy_smtpp

View File

@ -247,6 +247,7 @@ void * proxychild(struct clientparam* param) {
int redirect = 0;
int prefix = 0, ckeepalive=0;
int ftp = 0;
int ssoff = 0;
#ifndef ANONYMOUS
int anonymous;
#endif
@ -338,6 +339,7 @@ for(;;){
if ((sb=(unsigned char *)(unsigned char *)strchr((char *)buf, ' ')) == NULL) {RETURN(512);}
ss = ++sb;
ssoff = (int)(ss - buf);
if(!isconnect) {
if (!strncasecmp((char *)sb, "http://", 7)) {
sb += 7;
@ -640,6 +642,7 @@ for(;;){
ckeepalive = 1;
if(ftpbase) free(ftpbase);
ftpbase = NULL;
ss = buf + ssoff;
if(!(sp = (unsigned char *)strchr((char *)ss, ' '))){RETURN(799);}
*sp = 0;

View File

@ -27,6 +27,10 @@
#define WINAPI
#endif
#if defined(WITH_WOLFSSL) && !defined(SSL_set_mode)
#define SSL_set_mode(ssl,op) ((void)0)
#endif
#ifndef isnumber
#define isnumber(i_n_arg) ((i_n_arg>='0')&&(i_n_arg<='9'))
#endif

View File

@ -1,14 +1,14 @@
#ifndef VERSION
#define VERSION "3proxy-0.9.7"
#define VERSION "3proxy-0.9.8"
#endif
#ifndef BUILDDATE
#define BUILDDATE ""
#endif
#define MAJOR3PROXY 0
#define SUBMAJOR3PROXY 9
#define MINOR3PROXY 7
#define MINOR3PROXY 8
#define SUBMINOR3PROXY 0
#define RELEASE3PROXY "3proxy-0.9.7(" BUILDDATE ")\0"
#define RELEASE3PROXY "3proxy-0.9.8(" BUILDDATE ")\0"
#ifndef YEAR3PROXY
#define YEAR3PROXY "2026"
#endif