You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,20 @@ All notable changes to EngineScript will be documented in this file.
4
4
5
5
Changes are organized by date, with the most recent changes listed first.
6
6
7
+
## 2026-04-12
8
+
9
+
### 🔒 VHOST INSTALL SECURITY & VALIDATION FIXES
10
+
11
+
- Removed `database_name` and `database_user` lowercase normalizations from `scripts/functions/vhost/vhost-install.sh`; the random character sources (`RAND_CHAR4` and `RAND_CHAR16`) are `a-zA-Z0-9` and must not be altered, as normalization would corrupt generated identifiers.
12
+
- Updated `validate_db_identifier` regex from `^[a-z][a-z0-9_]*$` to `^[A-Za-z][A-Za-z0-9_]*$` to correctly accept mixed-case identifiers produced by `RAND_CHAR4`.
13
+
- Updated the pre-write `database_user` validation regex from `^[A-Za-z0-9_]+$` (already fixed from earlier lowercase-only pattern) to correctly reflect the `RAND_CHAR16` charset (`a-zA-Z0-9`).
14
+
- Updated the post-source `DB` validation regex from `^[a-z][a-z0-9_]*$` to `^[A-Za-z][A-Za-z0-9_]*$` to match the mixed-case database name.
15
+
- Updated the pre-write `database_password` validation regex to `^[A-Za-z0-9_]+$`, precisely matching the `RAND_CHAR32` charset (`a-zA-Z0-9_`), replacing the prior broader pattern that excluded `_` and would have incorrectly rejected valid generated passwords.
16
+
- Consolidated password validation to also reject single quotes and backslashes at the pre-write stage, eliminating a TOCTOU gap where a password could pass the first check but fail a later one.
17
+
- Added `escape_sql_string_literal()` helper function to safely escape MariaDB single-quoted string literals, guarding against SQL injection if password validation is ever bypassed.
18
+
- Used `printf -v` to prepare the `CREATE DATABASE` SQL statement separately before passing it to `mariadb -e`, reducing direct interpolation risk.
19
+
- Used `escape_sql_string_literal` on `PSWD` before interpolating into the `CREATE USER` SQL statement.
0 commit comments