Commit a269478
fix(roles): SQL injection in role management
Replace string concatenation with format() function in role management
scripts to prevent SQL injection with special characters in usernames
or passwords.
Use %I for identifier quoting and %L for literal escaping. While these
scripts are intended for DBA use in interactive sessions, using format()
is better practice and handles edge cases with special characters.
Files modified:
- roles/alter_user_with_random_password.psql
- roles/create_user_with_random_password.psql
Co-Authored-By: Claude <[email protected]>1 parent 1d47ee5 commit a269478
File tree
2 files changed
+12
-11
lines changed- roles
2 files changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments