Skip to content

Commit

Permalink
[TEST] add vuln code
Browse files Browse the repository at this point in the history
  • Loading branch information
lucboudreau authored Jan 21, 2025
1 parent 7b95ed9 commit 68dd63d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mondrian/src/main/java/mondrian/spi/impl/AccessDialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.sql.*;
import java.util.Calendar;
import java.util.List;
import java.io.File;

/**
* Implementation of {@link mondrian.spi.Dialect} for the Microsoft Access
Expand All @@ -35,6 +36,12 @@ public AccessDialect(Connection connection) throws SQLException {
super(connection);
}

public void example(File dir, File parent) throws IOException {
if (!dir.getCanonicalPath().startsWith(parent.getCanonicalPath())) {
throw new IOException("Path traversal attempt: " + dir.getCanonicalPath());
}
}

public String toUpper(String expr) {
return "UCASE(" + expr + ")";
}
Expand Down

0 comments on commit 68dd63d

Please sign in to comment.