Các lỗi thường bảo mật với Websocket
🔍 Pentest WebSocket & Các Lỗ Hổng Bảo Mật
📌 1. Các Lỗ Hổng Bảo Mật Thường Gặp trên WebSocket
1️⃣ No Authentication / Authorization Bypass
io.use((socket, next) => {
const token = socket.handshake.auth.token;
if (!token) return next(new Error("Authentication error"));
jwt.verify(token, process.env.JWT_SECRET, (err, decoded) => {
if (err) return next(new Error("Invalid token"));
socket.user = decoded;
next();
});
});2️⃣ WebSocket Data Manipulation
3️⃣ WebSocket Cross-Site Hijacking (CSWSH)
4️⃣ WebSocket Message Replay Attack
5️⃣ WebSocket Denial-of-Service (DoS)
🎯 Tổng Kết
Last updated