CVE-2023-25813 漏洞
自己使用Nestjs 搭配 Sequelize ,在安装新包的时候提示有Critical 风险。有漏洞嘛,要第一时间处理,要处理,除了升级,还要看一下这个漏洞如何复现。
粗略得到结果如下:
CVE-2023-25813
I、漏洞复现:
https://github.com/advisories/GHSA-wrh9-cjv3-2hpw
开发代码:
User.findAll({
where: or(
literal('soundex("firstName") = soundex(:firstName)'),
{ lastName: lastName },
),
replacements: { firstName },
})
用户输入:
{
"firstName": "OR true; DROP TABLE users;",
"lastName": ":firstName"
}
Sequelize预编译出SQL:
SELECT * FROM users WHERE soundex("firstName") = (:firstName) OR "lastName" = ':firstName'
占位符替换,最终会得到如下SQL:
SELECT * FROM users WHERE soundex("firstName") = soundex('OR true; DROP TABLE users;') OR "lastName" = ''OR true; DROP TABLE users;''
妥妥的SQL注入,高危风险。
II、漏洞预防
Do not use the
replacementsand thewhereoption in the same query if you are not using Sequelize >= 6.19.1
- 升级sequelize版本。
- where 与
replacements不要同时出现。
CVE-2023-22578
不算漏洞的漏洞,不要将用户输入作为列名。
https://github.com/advisories/GHSA-8mwq-mj73-qv68
https://github.com/sequelize/sequelize/discussions/15694
Hi!
At the present time I do not know.
The problem is that, while I did make the changes to remove a footgun in v7, that behavior was not a bug but a deliberate feature implemented by one of the previous teams that worked on Sequelize, and there are codebases relying on it.
Backporting #15374 would introduce a breaking change in a minor release. We've exceptionally done that in the past when we fixed a major issue (#14519), but I am not convinced that it's warranted for this one.
The reason I think releasing this breaking change in a minor release is unwarranted is that it can only be a problem if you use user-provided values as the name of a column to select. Even without the fix, you should make sure that input is safe as the query will crash if the input is not a valid attribute name.
We're stuck between a rock and a hard place. We can either introduce a breaking change in a minor release, or have a critically vulnerability warning.
We need to check with the people that published that vulnerability if they would consider a big bold warning that that property accepts arbitrary SQL (and therefore that user data should not be used in it) to be sufficient to dismiss the audit warning
CVE-2023-25813 漏洞的更多相关文章
- CVE补丁安全漏洞【学习笔记】
更新安卓系统的CVE补丁网站:https://www.cvedetails.com/vulnerability-list/vendor_id-1224/product_id-19997/version ...
- 漏洞都是怎么编号的CVE/CAN/BUGTRAQ/CNCVE/CNVD/CNNVD
在一些文章和报道中常常提到安全漏洞CVE-1999-1046这样的CVE开头的漏洞编号,这篇文章将常见的漏洞ID的表示方法做下介绍: 1.以CVE开头,如CVE-1999-1046这样的 CVE 的英 ...
- 支持nmap批量漏洞扫描的script
NSE脚本,会在NMAP扫描时,通过-sV发现的端口详细信息对应到CVE相应的漏洞: nmap -sS -sV --script=vulscan www.scip.ch -p25 下面是该脚本的说明和 ...
- Nagios Looking Glass 本地文件包含漏洞
漏洞名称: Nagios Looking Glass 本地文件包含漏洞 CNNVD编号: CNNVD-201310-682 发布时间: 2013-10-31 更新时间: 2013-10-31 危害等级 ...
- Apache Struts2 s2-020补丁安全绕过漏洞
CNVD-ID CNVD-2014-01552 发布时间 2014-03-11 危害级别 高 影响产品 Apache struts 2.0.0-2.3.16 BUGTRAQ ID 65999 CVE ...
- WordPress Backdoor未授权访问漏洞和信息泄露漏洞
漏洞名称: WordPress Backdoor未授权访问漏洞和信息泄露漏洞 CNNVD编号: CNNVD-201312-497 发布时间: 2013-12-27 更新时间: 2013-12-27 危 ...
- OpenSSL 拒绝服务漏洞
漏洞名称: OpenSSL 拒绝服务漏洞 CNNVD编号: CNNVD-201312-058 发布时间: 2013-12-05 更新时间: 2013-12-05 危害等级: 漏洞类型: 威胁 ...
- Python‘ssl.match_hostname()’函数SSL证书验证安全绕过漏洞
漏洞名称: Python‘ssl.match_hostname()’函数SSL证书验证安全绕过漏洞 CNNVD编号: CNNVD-201312-033 发布时间: 2013-12-04 更新时间: 2 ...
- Linux Kernel‘ieee80211_radiotap_iterator_init()’函数拒绝服务漏洞
漏洞名称: Linux Kernel‘ieee80211_radiotap_iterator_init()’函数拒绝服务漏洞 CNNVD编号: CNNVD-201312-041 发布时间: 2013- ...
- Linux Kernel ‘/net/socket.c’本地信息泄露漏洞
漏洞名称: Linux Kernel ‘/net/socket.c’本地信息泄露漏洞 CNNVD编号: CNNVD-201312-037 发布时间: 2013-12-04 更新时间: 2013-12- ...
随机推荐
- 认知篇:CQRS架构模式的本质
作者:京东科技 倪新明 CQRS只是一种非常简单的模式(pattern),CQRS本身并不是一种架构风格,和最终一致性/消息/读写分离/事件溯源/DDD等没有必然的联系,它最大优势是给我们带来更多的架 ...
- 数据结构-详解优先队列的二叉堆(最大堆)原理、实现和应用-C和Python
一.堆的基础 1.1 优先队列和堆 优先队列(Priority Queue):特殊的"队列",取出元素顺序是按元素优先权(关键字)大小,而非元素进入队列的先后顺序. 若采用数组或链 ...
- vue学习笔记(八)---- vue中的实例属性(wacth和computed的使用)
一.watch属性的使用 1.传统方式实现双向数据改变监听事件(姓名拼接案例) <div id="app"> 姓: <input type="text& ...
- Django3.X使用富文本编辑器kindereditor上传图片时一直转圈圈,如何解决
问题描述: 在写bbs项目的时候,老师用的是Django1.X结合富文本编辑器kindeditor,实现了图片上传,但是我在用Django3.X的时候,代码和老师一模一样,上传图片的时候一直转圈圈?? ...
- 虚拟机配置代理(虚拟机nat)
桥接 第一步:打开clash allow lan 第二步:找到宿主机在局域网中的IP地址 第三步:配置虚拟机代理 NAT 同上 注意 一.宿主机防火墙要配置好(直接关闭会也有效果, ...
- 力扣每日一题2023.1.16---1813. 句子相似性 III
一个句子是由一些单词与它们之间的单个空格组成,且句子的开头和结尾没有多余空格.比方说,"Hello World" ,"HELLO" ,"hello w ...
- 基于二叉树的高效IP检索格式MMDB
一.MMDB简介 MMDB(MaxMind Database) 是MaxMind推出的一个数据存储和检索的数据库格式,用于旗下针对IP检索和存储的Geo产品. IP格式由二进制比特数组组成,很容易想到 ...
- P33_小程序的页面配置
页面配置 页面配置文件的作用 小程序中,每个页面都有自己的 .json 配置文件,用来对当前页面的窗口外观.页面效果等进行配置. 页面配置和全局配置的关系 小程序中,app.json 中的 windo ...
- jsp传入servlet数据
面对老师的19级期末,要用到jsp传入servlet的数据传输,借鉴了其他人的代码,以下是我的程序 jsp界面: <%request.getSession().setAttribute(&quo ...
- JavaScript 中的 apply、call、bind
在 JavaScript 中,apply.call.bind 是三个与函数调用相关的方法,它们都允许你在调用函数时手动设置函数的上下文(即 this 指向). 1.apply 方法:apply 方法允 ...