Comments (9)
可以增加一个选项,例如 encodeUserInput option之类。
from js-realtime-sdk.
我觉得不用,有点超出库的范围了。XSS 是个 html 层面的事物,我们的库是个通信层面的库。我们在demo和未来的 UI 组件上可以做这个功能。现在我们连接上传输的内容不完全是最终会放在页面上的内容,替换<这些可能导致消息内容甚至格式变化。成熟的用户使用模版引擎的时候,这件事会在模版引擎层面做掉,如果我们在通信库层面做了,内容会被二次转义。
from js-realtime-sdk.
我很担心很多用户并不知道在 Web 上面要做 HTML 转义防止 XSS,同意晓丹的建议,我增加一个选项。但是默认是做 HTML 转义的,这样也能够说下我们的 SDK 是注重安全的。也能够支持宁姐的用法吧?成熟的用户知道要去关掉。
from js-realtime-sdk.
我个人觉的这个选项应该是默认关闭的,作为高级功能提供, js sdk 的文档需要增加一个单独的安全章节说明。
在 2015年3月31日 下午10:24,尼奥 [email protected]写道:
我很担心很多用户并不知道在 Web 上面要做 HTML 转义防止 XSS,同意晓丹的建议,我增加一个选项。但是默认是做 HTML
转义的,这样也能够说下我们的 SDK 是注重安全的。也能够支持宁姐的用法吧?成熟的用户知道要去关掉。—
Reply to this email directly or view it on GitHub
#54 (comment)
.
庄晓丹
Email: [email protected] [email protected]
Site: http://fnil.net
Twitter: @killme2008
from js-realtime-sdk.
加一个不停 XSS Demo 的用户进来讨论。。。 @zswang
from js-realtime-sdk.
我主要是考虑场景:
用户会在 Web 端使用,如果这样那他一定会做 XSS 防御,不管这个防御是在哪,他一定会去做。
所以感觉 SDK 默认防止 XSS 更好些,返回给他干净的字符串,用户可以通过配置不开启此功能。
from js-realtime-sdk.
不需要吧,你怎么知道哪个 json 是用来渲染的?不做渲染的 json 你编码了。。。这不是又一个坑。
from js-realtime-sdk.
一般不会有用户传递纯 HTML 吧?如果需要这样用,那就需要手工关掉是不是更好些?
from js-realtime-sdk.
最后支持 HTML 转义,防止 XSS,但默认不开启。
wangxiao@15eff2b
from js-realtime-sdk.
Related Issues (20)
- 更新 SDK,让美国节点彻底不依赖于注册在国内的域名。 HOT 1
- Typescript导入富媒体消息插件报错 HOT 5
- 处理连接断开后的清理工作时增加状态检查
- IMClient 监听一次‘message’ 回调函数触发三次 HOT 3
- web conversation.read 后 conversation.lastReadAt 不更新,并且 IOS .read 无响应
- CONVERSATION_QUERY_FAILED HOT 7
- 在 queryMessages 时,typescript 报错
- 心跳包 一直报错
- leancloud-realtime-plugin-typed-messages 发下新版? HOT 1
- 对话支持 and 与 or 查询
- 小程序 SDK 引入报错 HOT 2
- Error: App [qQS3pFiLfOx5YGlokrphiKqg-9Nh9j0Va] is aleady initialized. HOT 3
- TypeError: [object Object] is not a Message
- TypeError: [object Object] is not a Message
- 项目运行不了是为什么呢 HOT 3
- PersistentConversation#get 支持深度嵌套的 key HOT 2
- 优化 LiveQuery 订阅失败的处理
- 升级 5.0.0-rc.6 后,项目无法运行 HOT 8
- Warning Using browser-only version of superagent in non-browser environment HOT 10
- 初始化 Realtime 时 plugins 参数可以接受非数组,但类型定义文件中没有包含这种情况
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-realtime-sdk.