무결성 검증 없이 소프트웨어 업데이트를 적용하거나, 서명되지 않은 데이터를 신뢰하는 취약점입니다. CSRF, 안전하지 않은 파일 업로드 포함.
// ❌ 취약: CSRF 토큰 없음
<form method="POST" action="/dashboard/transfer">
<input name="to_username" value="attacker">
<input name="amount" value="1000000">
<!-- 어느 사이트에서도 이 폼 전송 가능 -->
</form>
// ❌ 취약: 파일 확장자 검증 없음
upload.single('file') // .js, .ejs, .html 모두 허용
// ✅ 안전: CSRF 토큰 검증
const csrf = require('csurf');
app.use(csrf());
// 폼에 토큰 포함
<input type="hidden" name="_csrf" value="<%= csrfToken() %>">
// ✅ 안전: 파일 타입 + 확장자 검증
const allowedExt = ['.jpg', '.png', '.pdf'];
const ext = path.extname(file.originalname).toLowerCase();
if (!allowedExt.includes(ext)) cb(new Error('허용되지 않는 파일'));