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

fix:validate region from url params to prevent xss attack #93

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

cinlo
Copy link

@cinlo cinlo commented Dec 3, 2024

Issue #, if available:

Description of changes:
This commit addresses a security vulnerability by adding input validation for the region parameter to prevent potential cross-site scripting (XSS) attacks. The main changes include:

  • A new function isValidRegion(region: string) is added to validate the region format using a regular expression. It ensures that the region string only contains alphanumeric characters and hyphens.
  • In the loadAndDisplayNotebook function, a check is added to validate the region before proceeding:
    ** If the region is invalid, an error message is displayed to the user.
    ** The function returns early, preventing further execution with an invalid region.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@zuoyuanh zuoyuanh merged commit 5353700 into aws:main Jan 6, 2025
1 check failed
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.

3 participants