schema: allow legal path characters and reject only real traversal
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/push/main Pipeline was successful
Accept a double dot inside a file name and '::' in a module path; reject only an absolute, drive, UNC or backslash path, duplicate separators, and '.'/'..' path segments. This matches the loader and avoids over-rejecting legal files.
This commit is contained in:
1 parent
7064c5f22c
commit
e0645f376b
1 file changed
+1
-1
@@ -137,7 +137,7 @@
|
||||
"relative_path": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"pattern": "^(?!/)(?!.*::)(?!.*(^|/)\\.\\.?(/|$))(?![A-Za-z]:)(?!.*\\\\)(?!.*//).*$"
|
||||
"pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.\\.?(?:/|$)).*$"
|
||||
},
|
||||
"source_digest": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"source": {"type": "string"},
|
||||
|
||||
Reference in new issue
Block a user