Excerpt -- wide character xss

Source: Internet
Author: User

Http://www.xssor.cn/sa

In fact, here baidu uses ajax to perform a series of operations, such as determining whether the URL is repeated and whether the submission is successful.
Ajax is returned in json format. The js that mainly processes the returned results isItemadd. js
Return page:

 

XML/HTML code
  1. {
  2. ResultNo:
  3. "Duplicate url ",
  4. ResultBool:
  5. False,
  6. ResultNum: 30005,
  7. UserLogin: "1 ",
  8. ItemId: "026aec1d90a1e9e5ea1182a1"
  9. }



If we only analyze the HTML page, we can't see any place where we execute JS, but our small box does pop up.

This is also a typical DOM XSS

The reason is that, inItemadd. jsMedium:

JavaScript code
  1. FunctionCheckForm (){
  2. VarF = document. fadd, oit = f. it, oiu = f. iu, odc = f. dc, otn = f. tn, vst = 0;
  3. If(F. st. checked =True)
  4. Vst = 1;
  5. If(Chek_submit (oit, oiu, odc, otn )){
  6. VarVit = oit. value, viu = oiu. value, vdc = odc. value, vtn = otn. value, url =/Do/cm;
  7. VarP_pars =Iu =+ Encode (viu) +& St =+ Encode (vst) +& Dc =+ Encode (vdc) +& It =+ Encode (vit) +& Tn =+ Encode (vtn );
  8. VarPars =Ct = 5 &+ P_pars;
  9. NewAjax. Request (url ,{
  10. Method:Post,
  11. Parameters: pars,
  12. OnComplete:Function(XmlHttp ){
  13. VarJsonResults =(+ XmlHttp. responseText +);
  14. VarRetno = eval (jsonResults );
  15. If(ParseInt (retno. userLogin) = 0 ){
  16. If(Nw =True)
  17. Location. href ="Http://passport.baidu.com /? Login & tpl = fa1 & next_target = _ blank & skip_ OK = 1 & u ="+ CheckUrl (location. href, 1800 );
  18. ElseLocation. href ="Http://passport.baidu.com /? Login & tpl = fa & skip_ OK = 1 & u ="+ CheckUrl (location. href, 1800 );
  19. Return
  20. }
  21. VarRetTxt = retno. resultNo;
  22. VarResultNum = retno. resultNum;
  23. If(RetTxt ="Duplicate url"){
  24. VarItemId = retno. itemId;
  25. If(Confirm ("The url is repeated. Is it overwritten? ")){
  26. NewAjax. Request (url ,{
  27. Method:Post,
  28. & Nb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.