微服务CodeQL越权查询demo

admin 2023年2月12日13:52:19评论88 views字数 800阅读2分40秒阅读模式

Java代码

@RequestMapping(value = "/testRequest",method = RequestMethod.GET)
public ModelAndView selectUser(int id) throws IoException(
Long userId = Long.parseLong(string.valueOf(id));
User user = this.userService.selectUser(userId);
ModelAndView mv = new ModelAndView() ;
string name = user.getUsername();
String email = user.getEmail();
mv.addobject("name", name);
mv.addobject("email",email);
return mv;




CodeQL代码


from RequestMapping rmapping, Method m, ModelAndView mv, Call c, UserService us, DataFlow df1, DataFlow df2
where rmapping.value = "/testRequest" and
rmapping.method = RequestMethod.GET and
rmapping.declaringType = m.declaringType and
m.hasAnnotation(rmapping) and
c.target = m and
c.returnValue = mv and
df1.to = c and
df1.from = df2.to and
df2.fromMethod = us.selectUser and
df1.from.kind = "PARAMETER" and
df1.from.name = "id"
select c, "越权查询"


原文始发于微信公众号(xsser的博客):微服务CodeQL越权查询demo

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年2月12日13:52:19
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   微服务CodeQL越权查询demohttps://cn-sec.com/archives/1548173.html

发表评论

匿名网友 填写信息