The vulnerability is a reflected Cross-Site Scripting (XSS) issue within the nltk.app.wordnet_app module of the NLTK library. The root cause lies in the page_from_reference function, which is responsible for generating HTML content for the WordNet browser application. When a user makes a request to a lookup_ URL, the provided input is processed and eventually passed as the word parameter to page_from_reference. The vulnerability is triggered when this word is not found in the WordNet dictionary. In this case, the function constructs an error message that includes the user-provided word directly in the HTML body without any sanitization or escaping. The patch applied in commit 1c3f799607eeb088cab2491dcf806ae83c29ad8f confirms this by adding html.escape() to the word variable before it is rendered. Therefore, page_from_reference is the precise location of the vulnerability, as it is the function that directly handles the unsafe input and generates the vulnerable output.