-
Notifications
You must be signed in to change notification settings - Fork 0
ファイル拡張子に正規表現を使用してしまわないように警告をフォームエディタに表示 #698
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
Open
Copilot
wants to merge
5
commits into
develop
Choose a base branch
from
copilot/fix-668-2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+57
−5
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: naohanpen <[email protected]>
Copilot finished work on behalf of
naohanpen
August 3, 2025 15:56
Coverage Report
File Coverage
|
Deploying sos25-client with
|
Latest commit: |
d8de4ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://29457c4b.sos25-client.pages.dev |
Branch Preview URL: | https://copilot-fix-668-2.sos25-client.pages.dev |
@copilot メッセージを表示する画面が間違えています。 |
…back Co-authored-by: naohanpen <[email protected]>
メッセージの表示場所を変更しました。警告は Commit: 253fdca Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot finished work on behalf of
naohanpen
August 3, 2025 23:29
naohanpen
approved these changes
Aug 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a security vulnerability in file extension validation where special regex characters could cause unintended behavior or regex errors, and moves the warning message to the appropriate admin interface.
Problem
The file extension validation in
FilesField.tsx
was directly inserting user-provided extensions into a regex pattern without proper escaping:This caused several issues:
*
would cause "Nothing to repeat" regex errors.*
would match any file (severe security issue)+
,?
,^
,$
, etc.) could break validation logicSolution
Created comprehensive regex escaping utilities in
src/lib/textUtils.ts
:escapeRegexCharacters()
: Properly escapes all regex special charactershasRegexSpecialCharacters()
: Detects potentially problematic characterscreateSafeExtensionRegex()
: Creates secure regex patterns from extension arraysUpdated FilesField component to use safe regex creation.
Added comprehensive test coverage with 21 test cases covering all edge cases and security scenarios.
Moved warning message to FormFieldEditor.tsx - The warning for special characters now appears in the form builder interface where administrators configure extensions, rather than in the file upload component shown to users.
Security Impact
Before:
After:
UI Changes
The warning message now appears in the admin form editor interface when administrators configure file extensions with special characters:
The fix maintains backward compatibility while preventing regex injection attacks and providing helpful warnings to administrators in the appropriate interface.
Fixes #668.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.