mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix(image-uris): broaden Unix path regex to include common Linux roots
Use /^[^?#]*\/(?:Users|home|root|var|tmp|opt)\/[^?#]{1,300}\.(png|jpg|jpeg|gif|webp)$/i to support Linux/macOS while keeping bounds and avoiding backtracking.
This commit is contained in:
parent
634ee677d9
commit
5d3f45bec0
1 changed files with 1 additions and 1 deletions
|
|
@ -85,7 +85,7 @@ function webviewUriToFilePath(webviewUri: string): string {
|
|||
// Use specific, bounded patterns to prevent ReDoS
|
||||
// Match exact patterns without backtracking
|
||||
const unixMatch = decoded.match(
|
||||
/^[^?#]*\/Users\/[a-zA-Z0-9._-]{1,50}\/[^?#]{1,300}\.(png|jpg|jpeg|gif|webp)$/i,
|
||||
/^[^?#]*\/(?:Users|home|root|var|tmp|opt)\/[^?#]{1,300}\.(png|jpg|jpeg|gif|webp)$/i,
|
||||
)
|
||||
if (unixMatch) {
|
||||
return unixMatch[0]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue