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

Need to Update Regex Patterns in Threat Protectors #7722

Closed
npamudika opened this issue Mar 4, 2024 · 0 comments
Closed

Need to Update Regex Patterns in Threat Protectors #7722

npamudika opened this issue Mar 4, 2024 · 0 comments

Comments

@npamudika
Copy link
Contributor

Description:
The patterns given in https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/threat-protectors/regular-expression-threat-protection-for-api-gateway/#denying-request-patterns are not correct for JavaScript Injection and XPath Injection.

For the XPath Injection .*'.*|(?\u003C![\w\d])or(?![\w\d])|.*1=1.*|.*ALTER.*|.*ALTER TABLE.*|.*ALTER VIEW.*| .*CREATE DATABASE.*|.*CREATE PROCEDURE.*|.*CREATE SCHEMA.*| .*create table.*|.*CREATE VIEW.*|.*DELETE.*|.*DROP DATABASE.*| .*DROP PROCEDURE.*|.*DROP.*|.*SELECT.* and for the JavaScript Injection \u003Cscript\b[^>]*>[^\/]+\s*\/\s*script\s*> should be used.

Please note that the above doc changes need to be done once wso2/api-manager#2549 is fixed to handle the encoded values at the Pattern.compile method in the mediator level.

Also in the table at https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/threat-protectors/regular-expression-threat-protection-for-api-gateway/#denying-request-patterns, "JavaScript Exception" should be corrected to "JavaScript Injection"

Affected Product Version:
APIM 4.2.0, APIM 4.1.0

Related Issues:
wso2/api-manager#2549

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

No branches or pull requests

2 participants