Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PG::Connection.escape_string as authorized sanitization function #1789

Conversation

joevin-slq-docto
Copy link
Contributor

@joevin-slq-docto joevin-slq-docto commented Aug 10, 2023

Hello,

In the same way as ActiveRecord::Base.sanitize_sql(), I suggest adding PG::Connection.escape_string() as an authorized function to sanitize sql statments.

Using this will never be as good as using prepared statements, but this addition, if deemed relevant, would limit false positives.

Thanks!
Nb: escape is an alias for escape_string.

@presidentbeef presidentbeef merged commit 4353b8a into presidentbeef:main Oct 13, 2023
8 checks passed
@presidentbeef
Copy link
Owner

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants