fix(search): use fixed-string matching to prevent ReDoS
Add -F flag to git grep to disable regex interpretation, preventing catastrophic backtracking from malicious query patterns.
This commit is contained in:
@@ -25,7 +25,8 @@ impl GitBare {
|
|||||||
"--git-dir".to_string(),
|
"--git-dir".to_string(),
|
||||||
self.bare_dir.to_string_lossy().into_owned(),
|
self.bare_dir.to_string_lossy().into_owned(),
|
||||||
"grep".to_string(),
|
"grep".to_string(),
|
||||||
"-I".to_string(), // don't match binary files
|
"-F".to_string(),
|
||||||
|
"-I".to_string(),
|
||||||
"--line-number".to_string(),
|
"--line-number".to_string(),
|
||||||
"--column".to_string(),
|
"--column".to_string(),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user