🇰🇷 한글 설명
WireGuard Portal(wg-portal) 2.1.3 미만 버전에서 발생하는 취약점으로, 인증된 일반 사용자가 자신의 프로필 업데이트 요청 시 JSON 바디에 'IsAdmin': true를 포함하여 전송하면 관리자 권한을 획득할 수 있습니다. 서버가 프로필 업데이트 시 IsAdmin 필드에 대한 보호 조치를 수행하지 않아 발생하는 권한 상승 취약점입니다.
💡 쉬운 설명
로그인한 일반 사용자가 프로필 정보를 수정하는 척하면서 '나는 관리자다'라는 정보를 몰래 끼워 넣어 보내면, 시스템이 이를 그대로 믿고 관리자 권한을 주는 문제입니다. 이 공격을 성공하면 공격자는 VPN 관리 시스템의 모든 제어권을 갖게 됩니다.
🇺🇸 원문 (English)
WireGuard Portal (or wg-portal) is a web-based configuration portal for WireGuard server management. Prior to version 2.1.3, any authenticated non-admin user can become a full administrator by sending a single PUT request to their own user profile endpoint with `"IsAdmin": true` in the JSON body. After logging out and back in, the session picks up admin privileges from the database. When a user updates their own profile, the server parses the full JSON body into the user model, including the `IsAdmin` boolean field. A function responsible for preserving calculated or protected attributes pins certain fields to their database values (such as base model data, linked peer count, and authentication data), but it does not do this for `IsAdmin`. As a result, whatever value the client sends for `IsAdmin` is written directly to the database. After the exploit, the attacker has full admin access to the WireGuard VPN management portal. The problem was fixed in v2.1.3. The docker images for the tag 'latest' built from the master branch also include the fix.
📍 영향받는 시스템
WireGuard Portal (wg-portal) version 2.1.3 미만
⚔️ 공격 벡터
인증된 사용자가 자신의 프로필 엔드포인트로 'IsAdmin': true가 포함된 PUT 요청을 전송
🛡️ 대응 방법
WireGuard Portal을 v2.1.3 이상 버전으로 업데이트하거나 최신 master branch 기반의 docker 이미지를 사용
🔧 검증 코드
출력된 이미지의 태그 또는 생성 날짜를 확인하여 v2.1.3 이상 버전이 적용되었는지 확인
docker images | grep wg-portal