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

SqlObfuscator does not obfuscate certain html documents #632

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

meiao
Copy link
Contributor

@meiao meiao commented Jan 4, 2022

Overview

When recreating a "raw" query from a PreparedStatement, the values from the params were added to the "raw" query without escaping any quotes inside of it.
This caused some problems later on when the obfuscator would try to match the quotes to remove any value in the query.

Fixed by escaping single quotes (unless it was already escaped using a \) prior to adding values to the "raw" query.

Related Github Issue

#568

Testing

Tests were added to verify the quotes were being properly escaped.

Checks

[Y] Are your contributions backwards compatible with relevant frameworks and APIs?
[N] Does your code contain any breaking changes? Please describe.
[N] Does your code introduce any new dependencies? Please describe.

parameters.put(1, "String1");
parameters.put(2, 1.0f);
parameters.put(3, 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This map was never used.

@twcrone twcrone self-requested a review January 4, 2022 19:11
@meiao meiao changed the title SqlObfuscator does not obfuscate certain html documents #568 SqlObfuscator does not obfuscate certain html documents Jan 4, 2022
@meiao meiao linked an issue Jan 4, 2022 that may be closed by this pull request
@meiao meiao merged commit dd774f0 into main Jan 6, 2022
@meiao meiao deleted the aonuki/#568-sql-obfuscation branch January 6, 2022 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

SqlObfuscator does not obfuscate certain html documents
3 participants