1. A method for detecting a document object model based cross-site scripting vulnerability, comprising: obtaining a set of parameter-value pairs from an original web address of a web page, wherein the set of parameter-value pairs comprises at least one parameter-value pair; replacing a parameter value in a parameter-value pair with feature code, to form a test web address for the web page, wherein the feature code comprises malicious code that comprises a malicious character and is uniquely identified in a document object model tree of the web page; obtaining page content corresponding to the test web address; converting the page content, into the document object model tree; and detecting whether a cross-site scripting vulnerability exists in the parameter-value pair, based on the document object model tree and the feature code.