-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenTelemetry for Eclipse Dirigible #4451
base: master
Are you sure you want to change the base?
Conversation
7ac9096
to
f58264f
Compare
/** | ||
* Put. | ||
* | ||
* @param projectName the project name |
Check failure
Code scanning / CodeQL
Partial path traversal vulnerability from remote Critical
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Partial Path Traversal Vulnerability due to insufficient guard against path traversal from
user-supplied data
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 6 days ago
To fix the partial path traversal vulnerability, we need to ensure that the directory path (registryPath
) is slash-terminated before checking if it is a prefix of the user-supplied path. This can be achieved by appending a slash to registryPath
if it is not already slash-terminated. Additionally, we should use Path
objects to perform the prefix check, as they handle path normalization and comparison more securely.
- Modify the
isValid
method to ensureregistryPath
is slash-terminated. - Use
Path
objects to perform the prefix check instead of string comparison.
-
Copy modified lines R259-R264 -
Copy modified line R266
@@ -258,10 +258,10 @@ | ||
public boolean isValid(String inputPath) { | ||
String registryPath = getDirigibleWorkingDirectory().toString(); | ||
String normalizedInputPath = java.nio.file.Path.of(inputPath) | ||
.normalize() | ||
.toString(); | ||
File file = new File(registryPath, normalizedInputPath); | ||
Path registryPath = getDirigibleWorkingDirectory().toPath().normalize(); | ||
if (!registryPath.toString().endsWith(File.separator)) { | ||
registryPath = registryPath.resolve(File.separator); | ||
} | ||
Path normalizedInputPath = java.nio.file.Path.of(inputPath).normalize(); | ||
Path filePath = registryPath.resolve(normalizedInputPath); | ||
try { | ||
return file.getCanonicalPath() | ||
.startsWith(registryPath); | ||
return filePath.toFile().getCanonicalPath().startsWith(registryPath.toString()); | ||
} catch (IOException e) { |
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
e5f36b5
to
cd86fdb
Compare
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
Signed-off-by: Iliyan Velichkov <[email protected]>
TODO