gpt4 book ai didi

javascript - JavaScript 有什么危害?

转载 作者:可可西里 更新时间:2023-11-01 02:18:40 25 4
gpt4 key购买 nike

我刚好看了乔尔的博客here ...

So for example if you have a web page that says “What is your name?” with an edit box and then submitting that page takes you to another page that says, Hello, Elmer! (assuming the user’s name is Elmer), well, that’s a security vulnerability, because the user could type in all kinds of weird HTML and JavaScript instead of “Elmer” and their weird JavaScript could do narsty things, and now those narsty things appear to come from you, so for example they can read cookies that you put there and forward them on to Dr. Evil’s evil site.

由于 javascript 在客户端运行。它只能在客户端访问或执行所有操作。

  1. 它可以读取存储在隐藏字段中的信息并更改它们。
  2. 它可以读取、写入或操作 cookies...

但我觉得,这些信息无论如何他都能得到。 (如果他足够聪明,可以在文本框中传递 javascript。那么我们不会向他提供新信息或向他提供对我们服务器的不当访问...

只是想知道我是否遗漏了什么。您能否列出恶意用户可以利用此安全漏洞执行的操作。

编辑:感谢大家的启发。正如 kizzx2 在其中一条评论中指出的那样......我忽略了一个事实,即用户 A 编写的 JavaScript 可能在许多情况下在用户 B 的浏览器中执行,在这种情况下,它会成为一个很大的风险。

最佳答案

Cross Site Scripting javascript 注入(inject)是一个非常大的问题

关于javascript - JavaScript 有什么危害?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4520118/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com