Commit Graph

25971 Commits

Author SHA1 Message Date
Ilia Ross
4af613a1a1 Fix API restriction preservation comment 2026-10-24 16:51:32 +02:00
Ilia Ross
0492b2fba9 Update language string 2026-10-24 16:39:27 +02:00
Ilia Ross
27b49c6a29 Fix to use description for API-only accounts 2026-10-24 14:09:50 +02:00
Ilia Ross
04b47e5815 Add API-only access for Webmin accounts
This PR adds an `api_only` global permission that restricts a Webmin account to one supported API endpoint, such as virtual-server/remote.cgi.

External integrations need credentials that can call an API without also granting access to the Webmin interface or generic RPC. Existing module permissions do not provide this endpoint-level restriction. The new setting allows administrators to create dedicated integration accounts while Webmin continues performing authorized operations through its privileged backend.

The restriction is enforced in two places:
- MiniServ checks the authenticated account's policy before dispatching CGI, static-file, DAV, or WebSocket requests. Requests outside the configured endpoint receive HTTP 403.
- `init_config` requires the permitted CGI to explicitly opt in before initialization. This also protects Webmin-initializing CGIs hosted by another web server.

Generic RPC is denied for API-only accounts, even when an existing RPC permission would otherwise allow it. The endpoint's own module and operation permissions still apply. Selecting an endpoint does not grant permission to execute every API command.

Webmin Users gains an API-only setting for users and groups. Existing restrictions survive ordinary edits, resets, copies, cloning, renaming, group propagation, and cluster synchronization. Clearing a restriction requires an explicit permission edit. Group updates preserve restrictions already assigned to individual members.

MiniServ reads the policy on each request from the account's existing storage backend: local files, MySQL, PostgreSQL, or LDAP. Policy-read errors deny access instead of treating the account as unrestricted.

Validation passed with the four separately submitted supporting fixes (#2897, #2898, #2899, #2900) ,applied: 169 focused tests, syntax checks, and live Debian tests using file-backed and PostgreSQL accounts. Live checks covered account creation, lifecycle operations, both CGI modes, sessions, RPC, static files, DAV, and WebSockets.

The supporting fixes remain separate PRs. This API-only branch currently has seven lifecycle test failures that depend on the file-cache and group ACL cleanup fixes landing.
2026-10-23 22:06:12 +02:00
Ilia Ross
1cade5b59e Fix dropdown menu positioning
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-10-23 05:37:52 +02:00
Ilia Ross
16148ed27e Fix button height and box-sizing for dropdowns and update display property
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
2026-10-23 05:20:31 +02:00
Ilia Ross
1d2ed64a36 Fix button styling and update link underlining rules for dropdown items 2026-10-23 04:41:51 +02:00
Ilia Ross
8953ff12b4 Fix underlines on links, button icon alignment and add pause icon 2026-10-23 03:54:44 +02:00
Ilia Ross
17a393a589 Fix MySQL import fallback for loopback and tunneled servers 2026-10-23 01:30:47 +02:00
Ilia Ross
c12fb7d438 Fix MySQL data imports with private temporary directories
This patch fixes CSV imports on systems such as AlmaLinux where MariaDB's `PrivateTmp` setting hides Webmin's temporary files.

The earlier permissions fix could not solve this because the database service still could not see the file.

Imports now use a unique directory under `secure_file_priv`, or the database's data directory, while retaining restricted file permissions and automatic cleanup.

The directory uses the `#sql-` prefix so MariaDB does not treat it as a database during listings, backups, or checks.

Verified live on Debian 13, AlmaLinux 10, Ubuntu 26.04 MariaDB and MySQL 8.4, including database listings and full dumps taken while an import is in progress.
2026-10-23 00:47:32 +02:00
Ilia Ross
3ccad807df Fix SMTP plaintext fallback after STARTTLS failure
This patch fixes mail sending and SMTP monitoring silently continuing without encryption when STARTTLS is rejected.

That fallback could expose passwords and email contents despite encryption being selected.

Both paths now require a valid STARTTLS success response and stop on failure, while successful TLS and explicitly configured plaintext connections remain supported.
2026-10-22 22:51:22 +02:00
Ilia Ross
3441040461 Fix mailbox attachment XSS bypasses 2026-10-22 22:23:23 +02:00
Ilia Ross
85b91de232 Update changelog 2026-10-22 22:15:59 +02:00
Ilia Ross
0cc60f0f4b Fix unsafe commands in existing Webalizer schedules 2026-10-22 21:47:59 +02:00
Ilia Ross
baad8643ae Fix log path HTML injection in Webalizer 2026-10-22 21:32:31 +02:00
Ilia Ross
1c2cff183e Fix username XSS in Fetchmail pages 2026-10-22 21:22:52 +02:00
Ilia Ross
01d70fdc53 Update changelog 2026-10-22 21:09:38 +02:00
Ilia Ross
130987be89 Fix MySQL server-side import of temporary files
This patch fixes MySQL imports that fail because the database server cannot read the temporary file.

Since the temporary copy is created with mode 0600, a server-side `mysqlimport` fails for imports from a local file, and for uploads by users with a Unix user restriction.

Before running the import as root against a local server, the file is now given the group of the running server process with mode 0640, so the server can read it while other users still cannot. The process is found through the server's reported PID file and must be `mysqld` or `mariadbd`; otherwise the permissions are left unchanged.
2026-10-22 21:05:39 +02:00
Ilia Ross
f6544c2700 Fix editing MySQL views with special-character names 2026-10-22 19:43:39 +02:00
Ilia Ross
9bad05a55d Fix XSS across MySQL database pages 2026-10-22 19:31:58 +02:00
Ilia Ross
400c326a1b Fix XSS in printer test forms and job lists 2026-10-22 18:30:42 +02:00
Ilia Ross
ef47bda30c Fix XSS in service monitor error messages
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
2026-10-22 18:16:32 +02:00
Ilia Ross
4bf0c7d652 Fix mail queue attachment XSS (more) 2026-10-22 17:35:27 +02:00
Jamie Cameron
670ed84b14 Escape more inputs
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-10-21 21:35:49 -07:00
Jamie Cameron
4f72773842 Fix incorrect parameter name 2026-10-21 20:54:41 -07:00
Jamie Cameron
5d9bbd8401 Escape potentially untrusted HTTP responses 2026-10-21 20:48:19 -07:00
Jamie Cameron
d59f5326a1 Merge pull request #2886 from webmin/dev/fix-rpc-deserialization
Fix RPC deserialization
2026-10-21 20:35:07 -07:00
Ilia Ross
dbb360b127 Add Data::Dumper parser module 2026-10-22 01:45:44 +02:00
Ilia Ross
ad4d56f050 Fix optional subtitle handling in log views
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-10-20 23:19:08 +02:00
Jamie Cameron
1d8608d61b Fix a bunch of missing 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
2026-10-19 21:44:06 -07:00
Ilia Ross
f59a235d17 Fix stale bytes in input reads
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
This patch fixes leaving old bytes in the input buffer when a later read is shorter.

Those extra bytes can corrupt ordinary HTTP RPC requests. Fast RPC is unaffected (discovered in deep tests with Virtualmin WP Workbench).

The reader now matches Perl's native read behavior, with regression tests for buffered and socket reads, offsets, and zero-length reads.
2026-10-20 03:10:24 +02:00
Ilia Ross
e764166ad4 Fix misleading temporary directory placeholder #2787 2026-10-19 21:50:30 +02:00
Ilia Ross
dfce125874 Fix server login and logout cookie validation to be numeric
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
2026-10-19 15:58:59 +02:00
Ilia Ross
aa82e2ebd5 Fix escaping too when updating MySQL backup schedules
c76255be5f
2026-10-19 15:44:25 +02:00
Ilia Ross
3466d09069 Fix printer-name XSS in empty job lists too 2026-10-19 15:41:25 +02:00
Ilia Ross
99a4aaf52c Update disk-only discovery wording and use named include-cds argument
#2880 clean up
2026-10-19 15:34:34 +02:00
Ilia Ross
9dd52da198 Merge pull request #2880 from Racerx323/fix/fdisk-disk-only-discovery
fdisk: add disk-only inventory discovery
2026-10-19 15:27:25 +02:00
Ilia Ross
91d3dd843b Fix unsafe fast RPC deserialization without dropping Data::Dumper support
https://github.com/webmin/webmin/pull/2886#issuecomment-6207458026
2026-10-19 01:49:05 +02:00
Jamie Cameron
db4d5d671c Delete unused support for a top frame
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-10-18 14:11:19 -07:00
Jamie Cameron
21c03e9120 Ensure cookie names are valid 2026-10-18 11:41:58 -07:00
Jamie Cameron
c76255be5f Escape DB name in cron command 2026-10-18 11:32:37 -07:00
Jamie Cameron
b35339094a Delete unused strings 2026-10-18 11:16:54 -07:00
Jamie Cameron
b661b5d163 Escape param included in header 2026-10-18 11:03:07 -07:00
Jamie Cameron
77f43d4f91 Merge branch 'master' of github.com:webmin/webmin 2026-10-18 10:59:57 -07:00
Jamie Cameron
1f5b440c71 Escape linktitle param for inclusion in the header 2026-10-18 10:59:17 -07:00
Ilia Ross
1a939a8e0a Fix to allow extractions for safe users
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
https://github.com/webmin/webmin/pull/2888
2026-10-18 19:19:25 +02:00
Jamie Cameron
c528155764 Merge pull request #2888 from webmin/dev/fix-restricted-archive-extraction
Fix archive extraction for directory-restricted users
2026-10-18 08:57:54 -07:00
Ilia Ross
4605a1b13f Update changelog for Ubuntu login detection fix and add tests 2026-10-18 16:12:21 +02:00
Ilia Ross
7522fbb249 Fix logged-in user detection without utmp
This patch fixes missing SSH logins on systems without `utmp`, including Ubuntu 26.04.

It adds a Systemd session helper, excludes manager and Webmin and Usermin sessions keeping `who` as the fallback and existing backend where `utmp` is present.

This complements mine earlier https://github.com/webmin/webmin/commit/8417d5c patch, which fixed parsing but could not get sessions missing from `who` output.

Tested on Ubuntu 26.04 Pro and AlmaLinux 10 Pro with both local live test and suites pass.
2026-10-18 16:11:20 +02:00
Ilia Ross
328b6ca7ba Fix logged-in user date rendering
https://forum.virtualmin.com/t/webmin-2-670-does-not-show-logged-in-users-from-the-users-and-groups-system-module-button-on-ubuntu-26-04-1-lts/138162/9
2026-10-18 14:32:55 +02:00