Skip to Main Content
Web开发的身份和数据安全
book

Web开发的身份和数据安全

by Jonathan LeBlanc, Tim Messerschmidt
January 2018
Intermediate to advanced content levelIntermediate to advanced
203 pages
3h 59m
Chinese
China Electric Power Press Ltd.
Content preview from Web开发的身份和数据安全
增强
Web
应用的安全
135
最后,基于
DOM
XSS
会修改客户端代码,经常攻击
URL
的片段标识符(一
种标记,常做导航用途)。
另一种基于
DOM
XSS
是修改
HTML5 LocalStorage
中的条目。
OWASP
布了一份速查表,在构建
HTML5
应用时方便我们检查应用的安全。
8
测试
XSS
保护机制
本节探讨基本的间接注入攻击的工作原理,并说明
Node
HTTP
和浏览器为
避免遭受这一攻击而提供的防护机制。
首先,我们要新建一个易受攻击的项目(使用
Express
生成器)。请在终端执
行下述命令:
express xss
cd express
npm install .
上述命令生成基本的应用结构。安装好所需的模块之后,开始实现基本的用
户注册功能,保存在
views/in-dex.jade
文件中。用户输入姓和名之后,在个人
资料页面显示出来。
extends layout
block content
h1 Registration
form(method='POST', action='/register')
fieldset
legend Your details
label(for='firstname') Firstname
input(id='firstname', name='firstname', type='text')
label(for='lastname') Lastname
input(id='lastname', name='lastname', type='text') ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow

Publisher Resources

ISBN: 9787519814205