Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 安全问题:graphql操作保存对象数据时,未校验数据信息,存在XSS漏洞 #6947

Open
hwzero opened this issue Jun 21, 2024 · 2 comments
Labels
bug Something isn't working help wanted

Comments

@hwzero
Copy link

hwzero commented Jun 21, 2024

Description

安全问题:graphql操作保存对象数据时,未校验数据信息,存在XSS漏洞

修复建议:

  1. ApiGateway统一对请求信息进行过滤,对容易引发XSS的内容的字符进行转义处理
  2. 对于cookies这种重要内容,下发时设置secure 属性和 httpOnly属性,防止XSS代码直接访问其中的敏感信息

Steps To Reproduce 重现步骤

举例:

  1. 公告->编辑
  2. 对标题进行修改,填写
    image
  3. 保存后查看
  4. 图片标签加载失败触发 onerror部分的回调函数
    image

Version 版本

2.5~2.7

@hwzero hwzero added bug Something isn't working needs triaging 需要分类 labels Jun 21, 2024
@hotlong hotlong added help wanted and removed needs triaging 需要分类 labels Jun 24, 2024
@hwzero
Copy link
Author

hwzero commented Jun 24, 2024

可以使用 sanitize-html 对输入数据库前 /或者 输出到网页渲染前 对内容进行过滤

@hotlong
Copy link
Collaborator

hotlong commented Jun 24, 2024

可能需要开通配置入口。 https://github.com/apostrophecms/sanitize-html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted
Projects
None yet
Development

No branches or pull requests

2 participants