Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
**Vulnerability:** The standard user authentication routes (login, register, and reset-password) did not have a maximum length constraint on passwords. This allows an attacker to supply extremely long strings, which `bcrypt` will try to hash, causing CPU exhaustion and creating a Denial of Service (DoS) vulnerability.
**Learning:** `bcrypt` (and `bcryptjs`) is intentionally slow. While `bcrypt` may internally truncate passwords to 72 bytes, depending on the implementation the input string processing itself or the full string parsing before truncation can be very costly. In this codebase, the admin authentication correctly checked for a max length, but user schemas did not.
**Prevention:** Always enforce a maximum string length limit (e.g. `.max(1024)`) on user inputs that will be passed into expensive algorithms like bcrypt hashing.

## 2025-02-18 - [ERD ๋ชจ๋ธ์˜ SQL ์ธ์ ์…˜ ๋ฐ ์ƒํƒœ ๋ณ€์ด ์šฐํšŒ ์ทจ์•ฝ์  ์ˆ˜์ •]
**Vulnerability:** `ERDModel` ํด๋ž˜์Šค์—์„œ ์ปฌ๋Ÿผ ํƒ€์ž… ๋ฐ ๊ธฐ๋ณธ๊ฐ’์— ๋Œ€ํ•œ ์ •๊ทœ์‹ ๊ฒ€์ฆ์ด ๋ˆ„๋ฝ๋˜์–ด ์•…์˜์ ์ธ SQL ๋ฌธ๋ฒ•์ด ์‚ฝ์ž…๋  ์ˆ˜ ์žˆ์—ˆ์œผ๋ฉฐ, ๋‚ด๋ถ€ ์ƒํƒœ ๊ฐ์ฒด(ํ…Œ์ด๋ธ”)๊ฐ€ ์ง์ ‘ ๋ฐ˜ํ™˜๋˜์–ด ๊ฒ€์ฆ ๋กœ์ง์„ ์šฐํšŒํ•˜์—ฌ ์ƒํƒœ ๋ณ€์ด๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
**Learning:** DDL ์ƒ์„ฑ ์‹œ ์ž์œ  ํ…์ŠคํŠธ๋‚˜ ํƒ€์ž… ์ž…๋ ฅ์ด ํฌํ•จ๋  ๋•Œ๋Š” ๋ฐ˜๋“œ์‹œ ํ—ˆ์šฉ ๋ชฉ๋ก(Allowlist) ๊ธฐ๋ฐ˜ ์ •๊ทœ์‹์„ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋ฉฐ, ๊ฐ์ฒด ์ƒํƒœ๋ฅผ ๋ฐ˜ํ™˜ํ•  ๋•Œ๋Š” ์บก์Аํ™”๋ฅผ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•ด ๊นŠ์€ ๋ณต์‚ฌ(Deep Copy)๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ๊ฒ€์ฆ ์šฐํšŒ๋ฅผ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
**Prevention:** ์ •๊ทœ์‹(์˜ˆ: `SAFE_SQL_TYPE`, `SAFE_SQL_DEFAULT_VALUE`)์„ ๋„์ž…ํ•˜์—ฌ ํƒ€์ž…๊ณผ ๊ธฐ๋ณธ๊ฐ’์„ ๊ฒ€์ฆํ•˜๊ณ , ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•  ๋•Œ `JSON.parse(JSON.stringify(table))`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›๋ณธ ์ฐธ์กฐ๋ฅผ ์ˆจ๊น๋‹ˆ๋‹ค.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Loading
Loading