- 经验值 595
| - F豆 6489 个
| - F币 43 元
- 贡献 0
| - 最后登录 2024-2-26
数据挖坑工程师,负责执行rm -rf,QQ624525513
最近公司在选型4A系统(4A系统是啥,简单的说就是统一登录平台,登陆了之后其他系统都不需要登录了),然后发现此4A系统与FR单点存在严重的安全漏洞,希望引起大家注意,下面附上具体代码
- <%[url=home.php?mod=space&uid=86279]@[/url] page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@ page
- import="com.fr.fs.base.entity.User,com.fr.fs.base.entity.UserInfo,com.fr.fs.control.UserControl,
- com.fr.fs.privilege.auth.FSAuthentication,com.fr.fs.privilege.base.FServicePrivilegeLoader,
- com.fr.fs.privilege.entity.DaoFSAuthentication,com.fr.privilege.session.PrivilegeInfoSessionMananger"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <%
- // 获取传过来的fr_username值
- String username = request.getParameter("fr_username");
- System.out.println(username);
- //如果用户名为空,跳转到登录页面
- if(username == null){
- response.sendRedirect("/ReportServer?op=fs");
- return;
- }
- try {
- User U = UserControl.getInstance().getByUserName(username);
- //如果报表工程里没有对应传过来的用户名对应的用户信息,跳转到登录页面
- if (U == null) {
- //改成自己的登录界面
- response.sendRedirect("/ReportServer?op=fs");
- return;
- }
- FSAuthentication authentication = new DaoFSAuthentication(new UserInfo(U.getId(), U.getUsername(), U.getPassword()));
- long userid = authentication.getUserInfo().getId();
- PrivilegeInfoSessionMananger.login(new FServicePrivilegeLoader(username, UserControl.getInstance().getAllSRoleNames(userid), UserControl.getInstance().getUserDP(userid)), session, response);
- session.setAttribute("fr_fs_auth_key", authentication);
- UserControl.getInstance().login(userid);
- //登录后跳转到决策平台地址,可以根据需要设置是否跳转及跳转的地址
- response.sendRedirect("/ReportServer?op=fs");
- return;
- } catch (Exception e) {
- e.printStackTrace();
- }
- %>
复制代码 以上代码是某4A平台提供的代码,需要将此代码放在FR的WebReport目录下,文件名为oaauth.jsp,
PS请各位检查一下服务器中是否有此文件,如有请立刻删除
代码解释:
其实就是通过4A平台传到此页面地址带上username,然后通过username获取user对象,此时user对象中包含用户名和密码,再将user拿去校验,此过程完全不需要传密码,即通过用户名直接获取用户名密码。
So....我希望FR也认真认真认真面对这个问题,这个UserControl.getInstance()类实在有点可怕,希望FR可以改进,谢谢
编辑于 2018-7-27 10:03
编辑于 2018-7-27 10:10
|
|