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

Correct regular expression range #2836

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Jul 17, 2024

Description

Regular expression [A-z] also matches the characters: [ \ ] ^ _ `. It may have overly permissive range risk. Correct it with [a-zA-Z_].

Issues Resolved

Resolves https://github.com/opensearch-project/sql/security/code-scanning/8

Check List

  • [-] New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • [-] New functionality has been documented.
    • [-] New functionality has javadoc added
    • [-] New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Lantao Jin <ltjin@amazon.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Just wonder previously this this a mistake instead of by design? Is it possible cx has such pattern that become illegal after this PR?

@LantaoJin
Copy link
Member Author

Thanks for the fix!

Just wonder previously this this a mistake instead of by design? Is it possible cx has such pattern that become illegal after this PR?

For backward compatibility, we can fix the security issue to add all characters: [ \ ] ^ _ ` to pattern. But it means we set them by design. @dai-chen

@dai-chen
Copy link
Collaborator

dai-chen commented Aug 6, 2024

Thanks for the fix!
Just wonder previously this this a mistake instead of by design? Is it possible cx has such pattern that become illegal after this PR?

For backward compatibility, we can fix the security issue to add all characters: [ \ ] ^ _ ` to pattern. But it means we set them by design. @dai-chen

Got it. Feel free to merge. Thanks!

@LantaoJin LantaoJin merged commit 7022a09 into opensearch-project:main Aug 7, 2024
15 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 7, 2024
Signed-off-by: Lantao Jin <ltjin@amazon.com>
(cherry picked from commit 7022a09)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
manasvinibs pushed a commit to manasvinibs/sql that referenced this pull request Aug 14, 2024
Signed-off-by: Lantao Jin <ltjin@amazon.com>
jzonthemtn pushed a commit to jzonthemtn/sql that referenced this pull request Aug 28, 2024
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants