Commit Graph

1318 Commits

Author SHA1 Message Date
Ilia Ross 463fcea730 Fix to require trusted proxies for SSL client cert headers
This PR tightens handling of proxied SSL client certificate headers so they are only honored when Webmin is configured to trust SSL headers and the direct TCP peer matches an explicit `trusted_proxies` entry.

The change preserves legacy forwarded-IP behavior for `trust_real_ip`, but prevents ambiguous legacy configs with no trusted proxy from accepting spoofable `X-SSL-Client-*` headers as authentication identity. During postinstall, such legacy configs now default to `no_trust_ssl=1`.
2026-06-30 14:23:01 +02:00
Ilia Ross 57ad5fa535 Update labels 2026-06-28 23:02:39 +02:00
Ilia Ross 2579cf54d9 Fix output 2026-06-27 23:45:31 +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
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 845f4a40e4 Fix not to print last extra line 2026-06-16 13:24:37 +02:00
Ilia Ross 8cca3a117f Fix IP address support for Webmin Let’s Encrypt certificates
ⓘ Support IPv4/IPv6 identifiers in Webmin Let’s Encrypt requests, add days/months renewal scheduling, and enforce safe automatic renewal defaults for short-lived IP certificates.

https://github.com/webmin/webmin/commit/a56748a3fc136ddaa6d24a626d100beb9a8b870a#r188893457
2026-06-16 03:15:02 +02:00
Jamie Cameron 804591f892 Merge branch 'master' of github.com:webmin/webmin 2026-06-13 18:51:30 -07:00
Jamie Cameron a56748a3fc Add support for IP-based lets encrypt certs, with version 5.3 of certbot 2026-06-13 18:49:12 -07:00
Ilia Ross 0d4c65ec04 Fix to create custom temp dirs after validation 2026-06-08 18:53:57 +02:00
Ilia Ross d788bbe9c2 Fix to add a placeholder to tempdir field 2026-06-06 22:49:37 +02:00
Ilia Ross 9577737aeb Fix to harden Webmin temp directory validation
https://github.com/webmin/webmin/pull/2749#discussion_r3368028469
2026-06-06 22:40:52 +02:00
Ilia Ross 80497c60b9 Update comment 2026-06-06 12:59:44 +02:00
Ilia Ross 6026a20424 Fix LE renewal to schedule by elapsed interval
The Webmin SSL LE renewal setting is labeled as "Months between automatic renewal", but it was previously saved as a calendar-style cron month expression like `*/N`.

That is not the same as an elapsed renewal interval. Webmin’s cron matcher evaluates month schedules against calendar month numbers, so values like `*/5`, `*/12`, or values above `12` do not reliably mean “renew every N months”. This could cause uneven or dangerously late renewal timing.

This changes the renewal job to use Webmin cron’s elapsed `interval` support instead of calendar-month matching.

- Saves automatic renewal as `renew * 30 * 24 * 60 * 60` seconds.
- Clears the cron time fields so the scheduler uses the interval path only.
- Keeps `months => '*/N'` so the SSL UI can continue to display the saved renewal value.
- Resets the renewal timer only after a newly issued certificate.
- Preserves the existing renewal timer for settings-only saves.
- Migrates existing month-based Let's Encrypt renewal jobs during postinstall.
2026-06-06 00:22:19 +02:00
Ilia Ross 501bddabc8 Fix to make temp dir perms message translatable 2026-06-05 22:13:48 +02:00
Ilia Ross e434d0b138 Fix to use a variable for default perms 2026-06-05 22:06:49 +02:00
Ilia Ross 80da8d1915 Fix Webmin temp directory setup in Advanced Options
This fixes saving a custom Webmin temp directory from Webmin Configuration → Advanced Options.

Previously, setting a path like /var/webmin/tmp failed if the directory did not already exist. Users had to create it manually, and it was easy to end up with a bad parent directory such as /var/webmin with 0700, which made the saved temp path unusable.

This change makes Webmin handle the safe parts automatically:

- Creates missing temp directories and parents as 0755

- Validates existing parent directories are traversable by group/other

- Requires the final Webmin temp directory to be root-owned with mode 0755

- Allows shared temp dirs like /var/tmp when root-owned and 1777

- Shows a clear error when existing permissions must be fixed manually
2026-06-04 01:44:32 +02:00
Ilia Ross 435d2db4c6 Fix to use stronger defaults for generated keys
https://github.com/webmin/webmin/issues/2728
2026-05-31 20:42:33 +02: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
Ilia Ross 9dccd2cdce Add comments
[no-build]
2026-05-11 21:16:26 +02:00
Ilia Ross 1645cadc91 Fix stored passphrase file lookup
* Note: Make passphrase lookup use the same fallback path for full fingerprints, key IDs, and legacy generic passphrase files.

https://forum.virtualmin.com/t/usermin-gpg-encryption/136781/8?u=ilia
2026-05-11 21:14:12 +02:00
Joe Cooper 241abfe719 Add trusted_proxies config 2026-05-10 01:19:01 -05:00
Ilia Ross a7afa3a4f6 Update translations 2026-04-24 22:36:48 +02:00
Ilia Ross db17606643 Fix clarify remember-me authentication option label
https://github.com/webmin/webmin/issues/2674
2026-04-24 22:35:03 +02:00
Ilia Ross d567b09d24 Fix to handle Certbot standalone port conflicts
* Note: Add Certbot port-80 warnings and shared runtime checks, while respecting pre-request hooks that may free the port before standalone validation runs.

https://github.com/webmin/webmin/issues/2669#issuecomment-4274711184
2026-04-19 02:00:21 +02:00
Ilia Ross 12069d87af Fix to redirect to SSL edit page with Let's Encrypt tab
https://github.com/webmin/webmin/commit/544703c1b8de8c3b5a2f141efeda808f436e7ef3#r182819336
2026-04-19 00:11:17 +02:00
Ilia Ross 6c211e721c Update translations 2026-04-18 19:50:53 +02:00
Ilia Ross bb39d752a9 Update description text and UX 2026-04-18 19:50:26 +02:00
Ilia Ross ae35b100c2 Update tiny ACME client 2026-04-18 19:35:27 +02:00
Ilia Ross 84c50bba95 Update translations 2026-04-18 19:35:09 +02:00
Ilia Ross 544703c1b8 Add custom ACME server support to Webmin SSL renewal
* Note: Adds support for custom ACME directory URLs in Webmin’s SSL certificate flow, including optional EAB credentials, renewal persistence, and compatibility fixes for saved validation modes.

https://github.com/webmin/webmin/issues/2669
2026-04-18 19:34:03 +02:00
Ilia Ross 44c7b36160 Fix saved LE validation mode handling
https://github.com/webmin/webmin/issues/2669
2026-04-18 14:59:51 +02:00
Ilia Ross 4d680b1ea9 Fix SHA512/yescrypt error messages to reflect crypt() support
https://github.com/webmin/webmin/issues/2656
2026-04-17 14:36:27 +02:00
Ilia Ross a293fff996 Fix to default TOTP QR generation to QRCode::Encoder
Webmin now uses the bundled QRCode::Encoder implementation by default to generate TOTP QR codes locally and inline, without relying on qr.cgi or external services.

This encoder requires Perl 5.24 or newer, so qrencode is no longer included as a recommended package dependency. On older systems where the bundled encoder cannot run, admins can still install qrencode manually to restore QR generation support.

Systems old enough to lack Perl 5.24 are typically already well past their supported security lifecycle, so keeping qrencode preinstalled by default is no longer treated as a packaging requirement. When neither option is available, Webmin falls back cleanly to manual TOTP setup using the shared secret.

https://github.com/webmin/webmin/issues/2667#issuecomment-4247431279

[no-build]
2026-04-16 23:08:00 +02:00
Ilia Ross ac8cbf57f9 Fix to handle HTTPS update sources with outbound SSL fallback 2026-04-10 18:56:41 +02:00
Ilia Ross 3f3a84c830 Fix to normalize URLs (more)
https://github.com/webmin/webmin/issues/2663
2026-04-10 15:27:28 +02:00
Ilia Ross dde3f1642e Fix to normalize URLs
https://github.com/webmin/webmin/issues/2663
2026-04-10 13:45:14 +02:00
Ilia Ross d2b4fa89c5 Fix to match short GPG key IDs to full fingerprints
https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/32?u=ilia
2026-03-29 15:20:10 +02:00
Ilia Ross 30f08f73fb Fix to support newer GnuPG passphrase handling
* Note: Use loopback pinentry for decrypt operation and retry decryption with the discovered secret key's stored passphrase on newer GnuPG versions

https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/26?u=ilia
2026-03-26 11:48:40 +02:00
Ilia Ross e499b5b3a5 Fix to use loopback pinentry mode for GPG passphrase handling
https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/19?u=ilia
2026-03-25 18:30:13 +02:00
Ilia Ross 443cf449eb Fix to use loopback pinentry for GPG decryption
https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/19?u=ilia
2026-03-25 12:52:26 +02:00
Ilia Ross bad0d2f821 Fix fields size
[no-build]
2026-03-16 11:22:13 +02:00
Jamie Cameron d467810076 Fix layout of from address field
https://github.com/webmin/webmin/issues/2644
2026-03-15 12:26:43 -07:00
Jamie Cameron cbd96a4176 Make code more readable 2026-03-11 16:43:46 -07:00
Ilia Ross ed17ade510 Fix not to leak 2FA auth secret to logs
https://github.com/webmin/webmin/pull/2638

[no-build]
2026-03-12 01:17:42 +02:00
Ilia Ross d7434c61a2 Fix to show post-save message about 2FA
https://forum.virtualmin.com/t/no-qr-code-displayed-when-selectinc-totp/136703/5
2026-02-28 22:17:11 +02:00
Ilia Ross 2397653d55 Fix IPv6 hostname matching for alwaysresolve access rules
* Note: Fix Miniserv IPv6 hostname resolution and matching used by access control when `alwaysresolve` is enabled:
  1. Correct `to_ip6address()` success handling (before getaddrinfo result was interpreted backwards)
  2. In `ip_match()`, resolve hostnames with `to_ip6address()` for IPv6 clients instead of IPv4-only `to_ipaddress()`
  3. Canonicalize IPv6 addresses before reverse and forward verification to avoid format-based mismatches.
  4. Mirror the IPv6 logic change in "webmin/webmin-lib.pl"

https://forum.virtualmin.com/t/webmin-access-control-for-domain-names-with-ipv6/136661?u=ilia
2026-02-21 13:30:08 +02:00
Ilia Ross c89dc4996f Fix to de-hardcode default temp directory path 2026-02-20 15:16:01 +02:00