-
Notifications
You must be signed in to change notification settings - Fork 4.4k
.Net: fix(security): fix improper URL encoding and add validation in Search… #13448
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
base: main
Are you sure you want to change the base?
Conversation
…UrlPlugin Security Issues Fixed: 1. Contextual Encoding Mismatch: Used UrlEncoder.Default (HTML context) instead of Uri.EscapeDataString (URL context) for query parameters 2. Query Parameter Injection: Special characters (&, =, #, ?) not properly encoded 3. Protocol Injection: No validation for javascript:, data:, http:// schemes 4. DoS Risk: No length limits on query parameters Changes: - production: Use Uri.EscapeDataString() for URL-safe encoding - production: Add ValidateQuery() method with security checks - production: Add GenerateSearchUrl() helper for consistency - tests: Update all assertions to expect proper encoding - tests: Add security validation tests Fixes CWE-138: Improper Neutralization of Special Elements
|
@SajanGhimire1 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
…UrlPlugin
Security Issues Fixed:
Changes:
Fixes CWE-138: Improper Neutralization of Special Elements
Motivation and Context
Description
Contribution Checklist