mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-28 09:41:08 -06:00
fix path traversal so static analysis can recognize it
This commit is contained in:
parent
81c7d47885
commit
38688dd6c6
@ -151,6 +151,9 @@ public class WorkSpace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void assertLegalWorkspacePath(Path target) {
|
private void assertLegalWorkspacePath(Path target) {
|
||||||
|
if (!target.normalize().startsWith(this.workspacePath)) {
|
||||||
|
throw new RuntimeException("workspace path '" + target + "' contains path traversal");
|
||||||
|
}
|
||||||
if (target.toString().contains("..")) {
|
if (target.toString().contains("..")) {
|
||||||
throw new RuntimeException("Possible path injection:" + target);
|
throw new RuntimeException("Possible path injection:" + target);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user