File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,12 @@ function validateGroupId(groupId: string): void {
4343
4444 // Reject path separators (both forward and backward slashes)
4545 if ( groupId . includes ( '/' ) || groupId . includes ( '\\' ) ) {
46- throw new Error (
47- 'groupId cannot contain path separators (/ or \\): path traversal detected' ,
48- ) ;
46+ throw new Error ( 'groupId cannot contain path separators (/ or \\)' ) ;
4947 }
5048
5149 // Reject relative path components
5250 if ( groupId === '..' || groupId === '.' ) {
53- throw new Error ( 'groupId cannot be "." or "..": path traversal detected ' ) ;
51+ throw new Error ( 'groupId cannot be "." or ".."' ) ;
5452 }
5553
5654 // Reject null bytes which can be used to bypass validation
Original file line number Diff line number Diff line change @@ -77,13 +77,13 @@ describe('ShardedWal', () => {
7777 describe ( 'path traversal validation' , ( ) => {
7878 it ( 'should reject groupId with forward slashes' , ( ) => {
7979 expect ( ( ) => getShardedWal ( { groupId : '../etc/passwd' } ) ) . toThrow (
80- 'groupId cannot contain path separators' ,
80+ 'groupId cannot contain path separators (/ or \\) ' ,
8181 ) ;
8282 } ) ;
8383
8484 it ( 'should reject groupId with backward slashes' , ( ) => {
8585 expect ( ( ) => getShardedWal ( { groupId : '..\\windows\\system32' } ) ) . toThrow (
86- 'groupId cannot contain path separators' ,
86+ 'groupId cannot contain path separators (/ or \\) ' ,
8787 ) ;
8888 } ) ;
8989
@@ -134,7 +134,7 @@ describe('ShardedWal', () => {
134134 getShardedWal ( {
135135 measureNameEnvVar : 'CP_PROFILER_MEASURE_NAME' ,
136136 } ) ,
137- ) . toThrow ( 'groupId cannot contain path separators' ) ;
137+ ) . toThrow ( 'groupId cannot contain path separators (/ or \\) ' ) ;
138138 } ) ;
139139 } ) ;
140140
You can’t perform that action at this time.
0 commit comments