The lab
here is how portswigger describes it
This lab's verbose error messages reveal that it is using a vulnerable version of a third-party framework. To solve the lab, obtain and submit the version number of this framework.
the app uses a product id in the url and expects it to be a number. when something unexpected happens the app does not fail quietly, it hands back a full stack trace, and that trace names the framework and its exact version. so the whole task is to deliberately break the app in a harmless way, feed it a value it cannot handle, and read the version out of the error it spills.
why a verbose error leaks this#
an error message is meant for whoever is debugging, and in development a full stack trace with framework names and versions is useful. left on in production it is a gift to an attacker, because knowing the exact framework and version turns a blind test into a targeted one, you can look up known vulnerabilities for that precise build. here the app trusts productId to be an integer, and when we hand it something it cannot parse, the unhandled exception is rendered straight back to us with the framework version in the trace.
Step 1 - Find the typed parameter#
we notice the product pages use a productId parameter in the url. we send the normal request to Repeater to work on it:
GET /product?productId=1

Step 2 - break the expected type#
we change productId from an integer to a non-integer, such as a string, and send it:
GET /product?productId=example

the unexpected data type causes an exception, and a full stack trace is returned in the response. reading it we see the lab is running Apache Struts 2 2.3.31.
Step 3 - submit the version#
we go back to the lab, click Submit solution, and enter the version:
2 2.3.31

with this, the lab is solved!
