CVE-2025-26467 复现记录

Apache Cassandra: User with MODIFY permission on ALL KEYSPACES can escalate privileges to superuser via unsafe actions (4.0.16 only)
项目地址: https://github.com/apache/cassandra
漏洞版本: https://github.com/apache/cassandra/releases/tag/cassandra-4.0.16
文章地址: https://github.com/advisories/GHSA-5c4f-pxmx-xcm4
权限相关官方文档: https://cassandra.apache.org/doc/4.0/cassandra/cql/security.html
猜测这个漏洞可能和 CVE-2025-23015 有点关系,于是搜索 CVE-2025-23015,在 Security Advisory for Apache Cassandra Vulnerabilities - CVE-2025-23015, CVE-2025-24860, and CVE-2024-27137 - Instaclustr 看到
利用方式是修改 system_auth ,这个是用来处理用户凭据、角色和权限、权限分配的。
这样看的话,如果一个用户拥有 ALL KEYSPACES 的修改权限,那么可以通过修改 system_auth 来提权好像就挺合理的。
对比两个版本的代码 https://github.com/apache/cassandra/compare/cassandra-4.0.16...cassandra-4.0.17,发现在新一版的 src/java/org/apache/cassandra/service/ClientState.java 中增加了下面的内容:
从注释可以了解到:即使一个用户拥有 ALL KEYSPACES 权限,这个权限也不应该自动扩展到系统 keyspace(包括 system_auth)。系统 keyspace 的访问需要显式授权,并且有更严格的权限限制(在 Permission 枚举中定义)。
可以模仿 test/unit/org/apache/cassandra/auth/GrantAndRevokeTest.java 里的语句来做 exp
复现过程
1、用 docker 起一个 4.0.16 的 cassandra,进入容器安装 vim,将 /etc/cassandra/cassandra.yaml 中的 AllowAllAuthenticator 改成 PasswordAuthenticator,AllowAllAuthorizer 改成 CassandraAuthorizer ,然后用密码登录(cassandra:cassandra):
2、新建一个用户并授予权限:
1 | CREATE ROLE test_user WITH LOGIN = TRUE AND password='pass'; |
3、切换测试用户登录,修改 system_auth.roles 表
1 | UPDATE system_auth.roles SET is_superuser = True WHERE role = 'test_user'; |
可以看到,在修改之前是没有权限执行 LIST ALL PERMISSIONS;
等命令的:
修改后就都能执行了:
4、用相同操作对 4.0.17 进行测试:
执行失败。并且发现 cassandra 的权限管理也细化了
- Title: CVE-2025-26467 复现记录
- Author: exp3n5ive
- Created at : 2025-09-22 07:55:25
- Updated at : 2025-09-24 15:19:39
- Link: https://exp3n5ive.github.io/2025/09/22/CVE-2025-26467/
- License: This work is licensed under CC BY-NC-SA 4.0.