Commit Graph

396 Commits

Author SHA1 Message Date
Ilia Ross
a13461f9c1 Fix to respect global file ACLs for server-local imports
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
ⓘ Centralize global file ACL checks for server-local reads and applies them to batch, LDAP batch, MySQL, and PostgreSQL local import and restore flows. Files are read under the configured `fileunix` identity and staged with the correct command-user ownership, preventing constrained Webmin users from bypassing `root`, `otherdirs`, or `fileunix`.

9ceffce70f (r191495975)
2026-07-07 12:39:35 +02:00
Ilia Ross
2e0028cb65 Fix to harden local batch file ACL checks
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
ⓘ Fail closed when checking local batch file imports for Webmin-only users that do not have a Unix home directory.

This prevents an unset global file root ACL, or a home-relative root such as `~/path`, from being treated as filesystem-root access. Explicitly configured allowed directories still work as before.
2026-07-07 00:47:22 +02:00
Ilia Ross
9ceffce70f Fix local batch file imports to enforce file access ACLs
ⓘ This tightens local server-side batch file execution in the Users and Groups module.

Both user and group batch endpoints now read local batch files through a shared helper that enforces the module `batchdir` ACL, the user’s global file chooser ACL (`root` / `otherdirs`), and the configured `fileunix` read identity. Existing ACLs remain compatible by treating a missing `batchdir` as `/`, while an explicitly blank value denies local server batch files.

Regression coverage was added for allowed paths, denied paths, `otherdirs`, missing/blank `batchdir`, symlink escape rejection, and successful local batch reads.

----

Reproduction / verification steps:

1. Create a constrained Webmin user with access to the `Users and Groups` module.

2. Set the user's Global ACL:

   - Root directory for file browser: `/home/user1`
   - Other directories to allow: empty
   - Browse as Unix user: `nobody`

3. Set the user's `Users and Groups` module ACL:

   - Can view batch file form?: `Yes`
   - Batch files must be under directory: `/`

4. Create test files on the Webmin host:

   ```sh
   sudo mkdir -p /home/user1

   echo ROOT_SECRET_MARKER | sudo tee /root/batch-secret.txt >/dev/null
   sudo chown root:root /root/batch-secret.txt
   sudo chmod 600 /root/batch-secret.txt

   echo ALLOWED_BATCH_MARKER | sudo tee /home/user1/allowed.batch >/dev/null
   sudo chmod 644 /home/user1/allowed.batch

   sudo ln -sf /root/batch-secret.txt /home/user1/link-secret.batch

   echo ROOT_ONLY_ALLOWED_MARKER | sudo tee /home/user1/root-only.batch >/dev/null
   sudo chown root:root /home/user1/root-only.batch
   sudo chmod 600 /home/user1/root-only.batch
   ```

5. Log in to Webmin as the constrained user and request:

   ```text
   /useradmin/batch_exec.cgi?source=1&local=/root/batch-secret.txt
   /useradmin/gbatch_exec.cgi?source=1&local=/root/batch-secret.txt
   ```

   Expected fixed result:

   ```text
   Local file location is not allowed
   ```

6. Request an allowed readable file:

   ```text
   /useradmin/batch_exec.cgi?source=1&local=/home/user1/allowed.batch
   /useradmin/gbatch_exec.cgi?source=1&local=/home/user1/allowed.batch
   ```

   Expected fixed result:

   ```text
   Invalid action at line 1 : ALLOWED_BATCH_MARKER
   ```

7. Request a symlink inside the allowed directory that points outside it:

   ```text
   /useradmin/batch_exec.cgi?source=1&local=/home/user1/link-secret.batch
   /useradmin/gbatch_exec.cgi?source=1&local=/home/user1/link-secret.batch
   ```

   Expected fixed result:

   ```text
   Local file location is not allowed
   ```

8. Request a root-only file inside the allowed directory:

   ```text
   /useradmin/batch_exec.cgi?source=1&local=/home/user1/root-only.batch
   /useradmin/gbatch_exec.cgi?source=1&local=/home/user1/root-only.batch
   ```

   Expected fixed result:

   ```text
   Local file not found
   ```

The fixed behavior confirms that local batch file imports now enforce the configured global file ACL, reject symlink escapes, and read files using the configured Unix identity instead of the privileged Webmin process.
2026-07-07 00:29:14 +02:00
Jamie Cameron
e84e4c3fe6 Add new ACL option for batch directory
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-02 19:10:23 -07:00
Ilia Ross
db8e34e528 Fix to read SSH key from real home 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
ⓘ Display Webmin-managed SSH public keys from the configured real home directory for automatic home accounts, matching the save path and avoiding accidental blank key fields.
2026-06-24 00:54:26 +02:00
Ilia Ross
27dcd2db4a Fix to validate SSH public keys without root privileges 2026-06-23 12:41:58 +02:00
Ilia Ross
762e400156 Add editable SSH public keys for existing Unix users
This PR adds SSH public key management to the Users and Groups edit flow for existing Unix users.

Webmin stores its managed key with a readable marker in `authorized_keys`, validates submitted public keys, preserves unrelated keys, supports rename/update/remove flows, and performs user `.ssh` file operations as the target Unix user.

https://github.com/webmin/webmin/issues/1827
2026-06-22 01:34:40 +02:00
Jamie Cameron
1445cd7641 Check permission to delete home dirs in batch operations 2026-06-14 13:29:54 -07:00
Ilia Ross
ad06644617 Add minimal Alpine Linux compatibility
This PR adds baseline Alpine Linux support in Webmin with OS detection, APK package and update backend, OpenRC boot integration, ifupdown-style networking support and DHCPD defaults.

https://github.com/webmin/webmin/issues/2353
2026-06-06 23:11:25 +02:00
Ilia Ross
68aab1c057 Fix to use proper API for ACL pages
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
[no-build]
2026-04-23 22:07:13 +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
Jamie Cameron
019cc10b79 Use formal function parameters 2026-03-05 20:41:45 -08:00
Ilia Ross
07a11f7de6 Fix to use quotemeta to prevent shell injection in Useradmin module
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
2026-02-11 13:03:27 +02:00
Ilia Ross
dbc83bae55 Fix title consistency
[no-build]
2025-11-05 14:14:08 +02:00
Ilia Ross
d37b790492 Fix not to drop that last empty paragraph as it break one pixel-accurate UI 2025-11-04 00:52:19 +02:00
Jamie Cameron
37f1b52391 Don't try to run the last command if it's not installed
https://github.com/webmin/webmin/discussions/2161
2025-10-25 20:00:04 -07:00
Ilia Ross
695c78f631 Fix previously broken Farsi translations 2025-05-30 21:36:00 +03:00
Ilia Ross
833292c0d1 Add exported German language-neutral strings
https://github.com/webmin/webmin/discussions/2482
https://forum.virtualmin.com/t/on-the-rejection-of-gender-neutral-language/133527
2025-05-26 14:48:11 +03:00
Ilia Ross
532a8042c7 Fix to use German rules most people already accept 2/2
https://github.com/webmin/webmin/discussions/2482
2025-05-24 21:46:34 +03:00
Ilia Ross
501698ad4b Fix to use German rules most people already accept 1/2
https://github.com/webmin/webmin/discussions/2482
2025-05-24 20:43:25 +03:00
Jamie Cameron
c5b0e4c7ff Work on password reset for sudo-capable users 2025-05-03 22:05:46 -07:00
Ilia Ross
f880192526 Remove languages with 0% coverage
https://github.com/webmin/webmin/issues/2403#issuecomment-2652613588
2025-02-12 13:19:49 +02:00
MacSteini
cb008dd4f8 Update de 2025-02-05 01:18:30 +00:00
MacSteini
6ca9dedb29 Update de 2025-02-05 01:05:52 +00:00
Ilia Ross
433c4151fe Update translations 2025-02-01 12:18:33 +02:00
Ilia Ross
07e1655e14 Fix to improve option name 2025-02-01 12:04:10 +02:00
Jamie Cameron
6e6c9c26c7 Logic cleanup 2025-01-27 21:55:06 -08:00
Jamie Cameron
60bba6cb81 Modes can be a regular array 2025-01-27 21:44:53 -08:00
Jamie Cameron
6114028aea Set old user environment variables https://github.com/virtualmin/virtualmin-gpl/issues/995 2025-01-14 19:14:45 -08:00
MacSteini
162206949f Consecutive Spaces Replacement
Replaced multiple consecutive spaces with a single space
2024-12-16 16:57:09 +00:00
MacSteini
5ea0cc6b42 Trailing Spaces Removal
Removed trailing spaces
2024-12-16 15:16:55 +00:00
MacSteini
64598e5f39 Blanks Removal
Removed blanks before or after the equal sign
2024-12-16 12:59:19 +00:00
MacSteini
477982776c Updated de
Corrections (UTF-8, new lines at file end), amendments, updates
2024-11-26 01:43:34 +00:00
Ilia Ross
5931243e4d Fix to instruct the browser not to save password fields
https://github.com/webmin/webmin/issues/847#issuecomment-2480540430

[build]
2024-11-17 14:00:56 +02:00
MacSteini
9a797f0a0e Updated de 2024-11-14 01:10:28 +00:00
Ilia Ross
33afba1686 Fix to set default last to 1000
https://forum.virtualmin.com/t/is-this-process-normal-or-should-i-worry/128835/32?u=ilia
2024-10-23 01:29:23 +03:00
Ilia Ross
e43df47e41 Fix to set default last to 10000
https://forum.virtualmin.com/t/is-this-process-normal-or-should-i-worry/128835/32?u=ilia
2024-10-23 01:21:46 +03:00
Ilia Ross
1d57955672 Fix to call last command for the given user if no lastlog available 2024-10-22 19:19:47 +03:00
Ilia Ross
65d185bfdf Update translations 2024-10-20 16:17:42 +03:00
Ilia Ross
eb2cd4e142 Fix to display more accurate heading 2024-10-20 16:16:38 +03:00
Ilia Ross
21e110cc8a Fix to bring back support for limit in last command
https://forum.virtualmin.com/t/is-this-process-normal-or-should-i-worry/128835/10?u=ilia
2024-10-20 15:59:41 +03:00
MacSteini
261ff535e0 Updated de 2024-09-07 12:46:38 +01:00
Ilia Ross
fbee8f0588 Add logging for active FTP conns 2024-06-20 20:04:19 +03:00
Ilia Ross
4006b0454e Fix to escape and not to truncate username 2024-06-18 23:51:19 +03:00
Ilia Ross
5d4ab58baa Fix the regex for last command on FreeBSD 2024-06-18 23:50:12 +03:00
Ilia Ross
a75781d61a Fix the regex to correctly match the output of the last command on contemporary systems 2024-06-18 23:36:31 +03:00
Ilia Ross
548c078813 Fix not to truncate usernames 2024-06-18 20:23:22 +03:00
Jamie Cameron
33b591dfac Also check if hash format is valid for yescrypt 2023-08-03 14:49:04 -07:00
Jamie Cameron
4b03b80912 Generate new salt if salt isn't valid for SHA 2023-08-03 14:40:16 -07:00
iliajie
143fb86567 Update translations 2023-07-19 20:08:41 +03:00