cdk-team / cdk-team/CDK

建议在 check net.ipv4.conf.all.route_localnet 补充对利用所需其他条件的检查

Open
#83 5 comments 0 reactions 0 assignees View on GitHub
good first issue perf
Dominant language
Go
Stars
4.7k
Forks
608
PR merge metrics
No merged PRs in 30d

Description

hi, @neargle 师傅,我在本地对 CVE-2020-8558 的复现中发现,如果在 pod 中要访问 host 上的 localhost tcp 服务,除了需要 pod 和 host 的 `route_localnet` 为 1 之外,还需要以下两个条件之一,来通过 pod 收到 host 回复包之后的源地址检查:
1. pod 具有 `CAP_NET_ADMIN`,来修改 pod 中 127.0.0.1 的路由项

2. `/proc/sys/net/ipv4/conf/{all && interfaces}/rp_filter` 均为 0(interfaces 不包含 lo),`/proc/sys/net/ipv4/conf/{all || interface}/accept_local` 为 1

在 Evaluate 功能中的 check net.ipv4.conf.all.route_localnet 可以添加上述两个条件的判断,可以进一步判断是否可以利用。

如果需要我可以晚些时间提交 pr

[条件 1 参考的 issue](https://github.com/kubernetes/kubernetes/issues/90259#issuecomment-620214448)
[rp_filter, accept_local 的解释](https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt)
[其他人复现文章](https://paper.seebug.org/1938/#rp_filteraccept_local)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.