Skip to content

RenderControllerupdateLog方法中疑似存在水平越权漏洞 #39

@goldthree-shit

Description

@goldthree-shit

问题描述

RestUpdateController中的list方法中存在查询语句PageInfo<UpdateRecorde> pageInfo = updateRecordeService.findPageBreakByCondition(vo);,并且这个方法需要权限注解@RequiresPermissions("updateLogs"),但是在RenderControllerupdateLog方法中,也存在类似的查询语句model.addAttribute("list", updateRecordeService.listAll());,然而RenderControllerupdateLog方法并不存在相关的权限注解。攻击者是否可以通过直接访问RenderControllerupdateLog接口,从而绕过RestUpdateControllerlist方法的应有的权限保护,从而获取到敏感数据。

相关代码

  • 可以看见在这里需要@RequiresPermissions("updateLogs")
// in RestUpdateController
// 这个方法中存在一条查询语句
    @RequiresPermissions("updateLogs")
    @PostMapping("/list")
    public PageResult list(UpdateRecordeConditionVO vo) {
        PageInfo<UpdateRecorde> pageInfo = updateRecordeService.findPageBreakByCondition(vo);
        return ResultUtil.tablePage(pageInfo);
    }

public interface SysUpdateRecordeService extends AbstractService<UpdateRecorde, Long> {

    PageInfo<UpdateRecorde> findPageBreakByCondition(UpdateRecordeConditionVO vo);
}
// in SysUpdateRecordeMapper
<select id="findPageBreakByCondition" parameterType="com.zyd.blog.business.vo.UpdateRecordeConditionVO" resultMap="rm">
	SELECT
		t.*
	FROM
		sys_update_recorde t
	WHERE
		1 = 1
</select>
  • 然而在RenderController存在类似的查询, 缺乏相应的权限保护
// in RenderController
    @GetMapping("/updateLog")
    @BussinessLog(value = "进入更新记录页", platform = PlatformEnum.WEB)
    public ModelAndView updateLog(Model model) {
        model.addAttribute("list", updateRecordeService.listAll());
        return ResultUtil.view("updateLog");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions