CyberArk เป็นเครื่องมือสำหรับการเก็บ password (Password Vault) ซึ่งถือว่าได้รับความนิยมพอสมควร ล่าสุดดันเจอว่ามีช่องโหว่ทำให้ Hacker สามารถยึดเครื่องได้เลย โดยไม่ต้อง authentication เข้าสู่ระบบแต่อย่างใด
CyberArk เป็น Application ที่จะเข้ารหัส storage เพื่อเก็บ credential ต่างๆไว้ โดยมี Web Access ที่เป็น .NET Application โดยตัว application เองนั้นมี RESTAPI สำหรับให้โปรแกรมมีการเข้ามาตรวจสอบ password ได้ ตัว API จะมี URL เป็น
https://<CyberArk IP>/PasswordVault/WebServices/
ตัว API เองมีการฝั่ง endpoint ได้หลายแบบ ซึ่งปกติจะเป็นการเปิดให้ระบบอื่นๆเข้ามา authentication ผ่าน API โดย authentication token ที่ได้มาจากการ authentication จะถูกนำไปไว้ใน HTTP authorization header ซึ่ง Token ดังกล่าวทาง บริษัท RedTeam Pentesting พบว่าข้อมูลส่วนดังกล่าวประกอบด้วย base64 encoded ตัว .NET object ในลักษณะ serialized โดยการสร้าง Token ดังกล่าวกระทำโดย “CyberArk.Services.Web.SessionIdentifiers” ซึ่งใน class ดังกล่าวไม่ได้ทำการตรวจสอบความถูกต้องของ data ที่ถูก serializad ไว้ ดังนั้นเมื่อ Attacker ทำการส่ง .NET object ที่ฝัง malicious object ไว้ เมื่อทำการ deserialize ก็จะทำให้รันคำสั่งภายในเครื่องได้
1 2 3 4 5 6 |
$ ysoserial.exe -f BinaryFormatter -g TypeConfuseDelegate -o base64 -c "ping google.com" > execute-ping.txt $ curl -s -X GET -k \ --url 'https://<CyberArk>/PasswordVault/WebServices/PIMServices.svc/'\ 'Applications/?Location=\&IncludeSublocations=true' \ --header "authorization: $(cat execute-ping.txt)" \ --header 'content-type: application/json' |
ผลกระทบ: Remote Code Execution
ระบบที่ได้รับผลกระทบ: CyberArk Password Vault Web Access < 9.9.5, 9.10 หรือ 10.2.
วิธีการแก้ไข: Upgrade CyberArk Password Vault Web Access ให้เป็น version 9.9.5, 9.10 หรือ 10.2.
Source:: Redteam-Pentesting