We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a12b4e commit 9b41304Copy full SHA for 9b41304
shared/src/main/java/eu/maveniverse/maven/toolbox/shared/DirectorySink.java
@@ -101,7 +101,10 @@ private void accept(Artifact artifact) throws IOException {
101
output.verbose(" matched");
102
String name = artifactNameMapper.map(artifactMapper.map(artifact));
103
output.verbose(" mapped to name {}", name);
104
- Path target = directory.resolve(name);
+ Path target = directory.resolve(name).toAbsolutePath();
105
+ if (!target.startsWith(directory)) {
106
+ throw new IOException("Path escape prevented; check mappings");
107
+ }
108
if (!writtenPaths.add(target) && !allowOverwrite) {
109
throw new IOException("Overwrite prevented; check mappings");
110
}
0 commit comments