douchenzhan3050 2016-04-24 20:01
浏览 63
已采纳

在网站上尝试JS注入? - 警报('TK00000025')

I just received 20 submissions in a form hosted on my website within 2 minutes. The only field that is filled in says alert('TK00000025') and each submission increases this number up to alert('TK00000036'). The field switches between forms, so one form has this in the name section with the next form having it in the email section. After this, there are four blank entries.

What is this and why did it happen? Is there anything I should do to prevent it?

  • 写回答

1条回答 默认 最新

  • dongtan7639 2016-04-24 20:13
    关注

    In general:

    1) Never Insert Untrusted Data Except in Allowed Locations

    2) HTML Escape Before Inserting Untrusted Data into HTML Element Content

    3) Attribute Escape Before Inserting Untrusted Data into HTML Common Attributes

    4) JavaScript Escape Before Inserting Untrusted Data into JavaScript Data Values

    5) HTML escape JSON values in an HTML context and read the data with JSON.parse

    • JSON entity encoding
    • HTML entity encoding

    6) CSS Escape And Strictly Validate Before Inserting Untrusted Data into HTML Style Property Values

    7) URL Escape Before Inserting Untrusted Data into HTML URL Parameter Values

    8) Sanitize HTML Markup with a Library Designed for the Job

    9) Prevent DOM-based XSS

    If you do the fallowing I am sure you are pretty much safe as it is.

    reference: Prevention Cheat Sheet

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集