2 min read

GitHub容器注册表域名拼写陷阱:警惕“typo-squatting”式凭证窃取攻击

近期发现一个针对GitHub容器注册表(ghcr.io)的潜在安全威胁,攻击者利用了域名拼写错误(typo-squatting)的手段。

该攻击通过注册一个与GitHub容器注册表ghcr.io极为相似的域名ghrc.io,并配置其响应符合OCI(Open Container Initiative)注册表API规范。当用户在命令行工具(如Docker、Podman)或GitHub Actions等场景中,因误输入将目标指向ghrc.io时,该恶意域名会返回一个模拟ghcr.io的401认证错误,并包含一个指向“https://ghrc.io/token”的认证请求。此举意在诱导客户端将用户GitHub凭证(如用户名、密码或Personal Access Token)发送至攻击者控制的服务器,从而窃取敏感信息。

此种攻击的风险在于,一旦用户在错误域名上执行登录操作,或在CI/CD流程中配置了错误的目标注册表,其GitHub账户凭证便可能被泄露。攻击者可利用这些凭证进行恶意操作,例如推送包含恶意软件的镜像,或直接侵入用户GitHub账户。目前,除登录操作外,尝试匿名拉取或推送镜像至该错误域名,仅会泄露仓库名称,不会导致凭证泄露。

为防范此风险,用户应立即检查并更改任何可能已泄露的GitHub密码或Personal Access Token,并密切监控账户活动。同时,在任何涉及容器镜像注册表的操作中,务必仔细核对域名拼写,确保指向正确的官方地址。

ghrc.io Appears to be Malicious
A simple typo of ghcr.io to ghrc.io would normally be a small goof. You’d typically get a 404 or similar error, finally work out the issue, fix it, and move along. But in this case, that typo appears to be doing something very malicious, stealing GitHub credentials.What’s ghcr.io? First, a quick bit of background. ghcr.io is an OCI conformant registry for container images and OCI artifacts used by a lot of projects. It’s part of GitHub and is a very popular image and artifact repository used by open source projects.
订阅情报