Skip to content

Instantly share code, notes, and snippets.

@tuxology
Created May 3, 2019 13:31
Show Gist options
  • Save tuxology/3ce3bad86b1f9a29812b34cda81a7507 to your computer and use it in GitHub Desktop.
Save tuxology/3ce3bad86b1f9a29812b34cda81a7507 to your computer and use it in GitHub Desktop.
Path Traversal
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
String resourceName = req.getParameter( "resourceName" );
BufferedReader r = new BufferedReader( new FileReader( resourceName ) );
while ( ( x = r.readLine() ) != null ) {
resp.getWriter().println( x );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment