55 Commits

Author SHA1 Message Date
Ilia Ross
0eaf0ef80d Fix redirect ports and linked-server WebSocket routing
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
ⓘ Follow up on #2794 by making `redirect_port` work even when `redirect_host` is not set. Keep existing host precedence and correctly handle proxy headers, IPv6 addresses, default ports, and invalid port values.

ⓘ Fix linked-server by keeping the child URL recognizable to the parent, then generating the final WebSocket URL on the same host and port the browser is using. This keeps the connection working with the current Webmin session.
2026-07-15 20:38:41 +02:00
Ilia Ross
934073532f Fix to use the existing HTTP and FTP mode 7 callback 2026-07-14 02:27:10 +02:00
Ilia Ross
9dcdca7f1f Merge branch 'master' into dev/download-target-check 2026-07-14 00:58:07 +02:00
Ilia Ross
bf3cd03977 Fix to manually incorporated Jamie's 70011c1 change 2026-07-14 00:46:12 +02:00
Ilia Ross
64f67e63d5 Add regression coverage for warning-free empty values
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
https://github.com/webmin/webmin/issues/2793
2026-07-13 15:08:13 +02:00
Ilia Ross
1555224592 Fix to refactor download address checks to use callback bundles
ⓘ Extend HTTP and FTP download callbacks with destination validation while preserving legacy tracking callbacks and enforcing SSRF policy across redirects, proxies, caches, and direct/passive sockets.

https://github.com/webmin/webmin/pull/2789#discussion_r3567985773
2026-07-13 13:36:34 +02:00
Ilia Ross
f564a3127d Add regression tests previous patch
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
2026-07-12 23:50:48 +02:00
Ilia Ross
470b2b5533 Fix inet6 tests 2026-07-12 15:09:17 +02:00
Ilia Ross
1ca52c9a97 Add ACL controls for URL download destinations
Block non-public HTTP, HTTPS and FTP destinations by default in File Manager, Mailboxes and Upload and Download, with per-user IP/CIDR exceptions, redirect and proxy protection, cache isolation, and current-ACL enforcement for scheduled jobs.
2026-07-12 14:57:08 +02:00
Ilia Ross
2fb4eb1721 Fix linked-server uploads over partial TLS writes
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
ⓘ Stream linked-server request bodies in bounded chunks, retry partial SSL writes with byte-safe offsets, detect incomplete forwarding, and add regression coverage.

https://github.com/webmin/webmin/issues/2784
2026-07-10 14:48:47 +02:00
Ilia Ross
4fbb496002 Fix to resolve miniserv library path
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
ⓘ Load `miniserv-lib.pl` from the resolved `miniserv.pl` directory so symlinked daemon invocations find the helper library correctly.

f3b70b0458
2026-07-05 22:06:25 +02:00
Jamie Cameron
f3b70b0458 Merge pull request #2783 from webmin/dev/miniserv-helpers
Fix to extract miniserv helpers into library
2026-07-06 07:27:31 +12:00
Ilia Ross
f23620aebf Fix APT package arch normalization
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
ⓘ Normalize APT install-result names like `libtinfo6:amd64` to `libtinfo6` so scheduled updates can correctly detect dependency-updated packages and avoid false failure reports.

https://github.com/virtualmin/virtualmin-gpl/issues/1247
2026-07-05 14:26:35 +02:00
Ilia Ross
f71905fc83 Add new test for miniserv library loading 2026-07-05 03:11:21 +02:00
Ilia Ross
f16f99c074 Fix to extract miniserv helpers into library
ⓘ Move miniserv helper functions into `miniserv-lib.pl`, remove the caller guard from `miniserv.pl`, and keep tests loading the helper library directly while preserving daemon startup behavior.

https://github.com/webmin/webmin/pull/2695
2026-07-05 02:51:57 +02:00
Ilia Ross
01780834ba Fix to extract XML-RPC helpers from CGI entry point
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
ⓘ Move XML-RPC marshalling helpers into `xmlrpc-lib.pl`, remove the caller guard from `xmlrpc.cgi`, and preserve coverage through direct library tests plus the CGI invocation regression.

https://github.com/webmin/webmin/pull/2763
2026-07-05 01:56:56 +02:00
Ilia Ross
cc4bb35dee Update tests to recognize hex numeric HTML entities
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
2026-06-29 23:28:48 +02:00
Ilia Ross
d02f0b6cb5 Fix Let's Encrypt Certbot PEM path parsing
ⓘ Prevent Webmin from swallowing Certbot's key-path output when extracting PEM paths, while preserving IPv6 cert-name support and adding regression coverage.
2026-06-27 22:59:21 +02:00
Ilia Ross
c72d232e2f Fix to restrict Basic auth for websocket routes
ⓘ Require websocket routes to opt in with allow_basic_ws before Basic auth is accepted in session mode. Mark linked ws-link routes and no-cookie backend-session routes as allowed, while leaving normal session-backed routes unmarked.
2026-06-23 01:09:43 +02:00
Ilia Ross
26311baab9 Fix to use Webmin config locking for ws-link cleanup
ⓘ Make linked websocket teardown use the same `miniserv.conf.lock` convention as `link.cgi`, release the lock safely on cleanup errors
2026-06-22 20:34:00 +02:00
Ilia Ross
45ca170c20 Add support to proxy linked-server WebSockets
This PR adds general WebSocket proxying for linked Webmin servers, allowing modules such as `xterm` to work when opened through `servers/link.cgi`.

As requested in https://github.com/webmin/webmin/issues/1866.
2026-06-22 16:19:33 +02:00
Jamie Cameron
29c14acf98 Merge pull request #2749 from webmin/dev/tmp-dir-auto
Fix Webmin temp directory setup in Advanced Options
2026-06-19 12:52:18 -07:00
Ilia Ross
a9c6fe724a Fix IPv6 CIDR access control matching
This PR fixes Webmin IP access control handling for IPv6 CIDR prefixes that are not divisible by 8, such as `/29` as mentioned in this https://github.com/webmin/webmin/issues/1570 ticket.

Before Webmin validation rejected non-byte-aligned IPv6 network sizes, and the runtime matcher compared IPv6 networks only by whole bytes. This meant valid IPv6 CIDR prefixes could not be used safely in access control rules.

Changes:
- Allow IPv6 access-control prefixes from `/0` through `/128`, without requiring divisibility by 8.
- Add bit-accurate IPv6 prefix matching for ACL checks.
- Apply the same matching behavior in both `miniserv.pl` and `webmin/webmin-lib.pl`.
- Fix IPv6 canonicalization for `::` and trailing `::` forms used by the matcher.
- Add regression tests for `/0`, `/29`, `/32`, `/63`, `/64`, `/127`, and `/128`.
2026-06-19 14:50:24 +02:00
Ilia Ross
ccd2b13942 Fix to enforce private basename for Webmin temp dirs
ⓘ Adds hidden `tempdirname` support and normalizes custom temp paths so Webmin always uses a private final directory like `.webmin`, while keeping the existing permission checks.
2026-06-18 20:48:47 +02:00
Ilia Ross
74fd0ca12d Fix XML-RPC CGI execution under miniserv
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
ⓘ Allow xmlrpc.cgi to run when invoked through Webmin's internal CGI do() path while preserving require-safe helper tests, and add regression coverage for CGI header emission.

https://github.com/webmin/webmin/pull/2763#issuecomment-4726296870
2026-06-17 15:06:18 +02:00
Jamie Cameron
8157ff60d2 Merge pull request #2732 from swelljoe/ui-lib-tests-and-quote-escapes
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
Add some ui-lib tests and fix quote escapes
2026-06-16 22:29:23 -07:00
Joe Cooper
69548c4bb8 Escape in ui_select, too 2026-06-15 16:35:42 -05:00
Joe Cooper
7ca3819d2b xmlrpc.cgi strict, warnings, critic, tests, and security audit 2026-06-15 01:16:09 -05:00
Jamie Cameron
73821b72b0 Merge pull request #2729 from swelljoe/web-lib-funcs-test-data-transforms
Some checks failed
Tests / prove (push) Has been cancelled
Build / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled
Add web-lib-funcs data transform tests
2026-05-23 19:25:00 -07:00
Joe Cooper
76833b9e68 Add some ui-lib tests and fix quote escapes 2026-05-21 23:32:14 -05:00
Joe Cooper
9de7560728 Update t/README.md to cover stringy eval 2026-05-21 22:30:44 -05:00
Joe Cooper
2c4467a82e Handle lowercase 2FA secret 2026-05-21 18:01:25 -05:00
Joe Cooper
65c2a0da50 Fix warnings for undef in compare 2026-05-21 17:47:38 -05:00
Joe Cooper
da2090bad7 Add web-lib-funcs data transform tests 2026-05-21 17:21:44 -05:00
Joe Cooper
53c3bef94c Expand test coverage for check_ip6address 2026-05-20 16:36:28 -05:00
Joe Cooper
100253bec3 Fix quirks in trunc and split_quoted_string 2026-05-20 15:55:07 -05:00
Joe Cooper
3e38e3268e Fix check_ip6address in miniserv 2026-05-20 14:04:53 -05:00
Joe Cooper
d2ba0d910b Fix check_ip6address in web-lib-funcs 2026-05-20 14:04:37 -05:00
Joe Cooper
c487b579ed Add ip, paths, string tests for web-lib-funcs 2026-05-20 01:01:01 -05:00
Jamie Cameron
b2fec1756d Merge pull request #2716 from swelljoe/miniserv-tests-trois
Some checks failed
Tests / prove (push) Has been cancelled
webmin.dev: webmin/webmin / build (push) Has been cancelled
Even more unit tests for miniserv.pl
2026-05-18 20:30:47 -07:00
Joe Cooper
d1c6e8d3a3 Even more tests for miniserv.pl 2026-05-18 00:46:20 -05:00
Joe Cooper
d81eb13f22 Run tests on PR, add docs 2026-05-17 23:33:59 -05:00
Joe Cooper
ab37804ef9 Add docs for coverage 2026-05-17 23:17:15 -05:00
Joe Cooper
b658bdd3ed Remove comment noise about known bug in encrypt_sha512, as bug has been fixed by this PR 2026-05-17 19:30:38 -05:00
Joe Cooper
b71c046596 More miniserv.pl tests 2026-05-17 17:28:21 -05:00
Ilia Ross
3b819eafb5 Merge pull request #2705 from swelljoe/miniserv-unit-tests
rename miniserv-http_error.t to miniserv.t, test all subs
2026-05-17 23:24:04 +02:00
Joe Cooper
49138dc5b5 Capture warnings, instead of silencing 2026-05-17 16:14:23 -05:00
Ilia Ross
2d01675139 Fix reflected XSS in Webmin status messages
* Note: Escape the /webmin/ message parameter, strip restart redirect HTML to plain text, and harden filter_javascript().
2026-05-17 14:32:10 +02:00
Joe Cooper
bf5ae8b5e5 Accomodate modification in place
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-16 18:33:55 -04:00
Joe Cooper
d3c9f331c8 rename miniserv-http_error.t to miniserv.t, test all subs 2026-05-13 13:11:43 -05:00