Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.