[FIXED HUDSON-3415] XSS vulnerability in the search box. Fixed in 1.297.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16855 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-04-04 17:11:19 +00:00
1 parent d03c06f5b5
commit af07d8a215
3 files changed
+32 -6

No files matched your search

@@ -477,10 +477,7 @@ public abstract class HudsonTestCase extends TestCase {
* Performs a search from the search box.
*/
protected Page search(String q) throws Exception {
HtmlPage top = new WebClient().goTo("");
HtmlForm search = top.getFormByName("search");
search.getInputByName("q").setValueAttribute(q);
return search.submit(null);
return new WebClient().search(q);
}
/**
@@ -788,6 +785,13 @@ public abstract class HudsonTestCase extends TestCase {
return this;
}
public HtmlPage search(String q) throws IOException, SAXException {
HtmlPage top = goTo("");
HtmlForm search = top.getFormByName("search");
search.getInputByName("q").setValueAttribute(q);
return (HtmlPage)search.submit(null);
}
/**
* Short for {@code getPage(r,"")}, to access the top page of a build.
*/