Skip to content

Commit e86ab3b

Browse files
Potential fix for code scanning alert no. 5: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent b7551a6 commit e86ab3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/sql/role.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def escape_password_for_sql(password)
6868
# SCRAM-SHA-256 passwords contain $ characters that can be interpreted
6969
# by shell or string processing. Escape them to prevent mangling.
7070
if password.start_with?('SCRAM-SHA-256')
71-
password.gsub('$', '\$')
71+
password.gsub('\\', '\\\\\\\\').gsub('$', '\\$')
7272
else
7373
password
7474
end

0 commit comments

Comments
 (0)