Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 8 additions & 17 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
## 2025-02-15 - [Security Enhancements: URL Hardcoding & Security Headers]
**Vulnerability:** Hardcoded external URLs (https://argos-ai.xyz/dashboard) and missing critical HTTP Security Headers (X-Frame-Options, Strict-Transport-Security, etc.) were found in the application configuration.
**Learning:** Hardcoded production URLs in authentication flows (like impersonation) can cause dangerous cross-domain redirects if the application is self-hosted on a different domain. Missing security headers leaves the application vulnerable to basic UI redressing (Clickjacking) and MITM attacks without HSTS.
**Prevention:** Always use relative paths (e.g., `/dashboard`) or dynamic environment variables (`NEXT_PUBLIC_SITE_URL`) for internal redirects. Always configure standard security headers (`X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`, `Strict-Transport-Security`) globally via `next.config.ts`.
## 2025-02-15 - [Host Header Injection ๋ฐฉ์ง€]
**Vulnerability:** `req.nextUrl.origin`์„ ์‚ฌ์šฉํ•˜์—ฌ ๋™์ ์œผ๋กœ URL์„ ์ƒ์„ฑํ•˜๋Š” ๋ถ€๋ถ„(๋น„๋ฐ€๋ฒˆํ˜ธ ์ดˆ๊ธฐํ™” ๋งํฌ ์ƒ์„ฑ, CLI ์ธ์ฆ URL ๋“ฑ)์—์„œ Host Header Injection ์ทจ์•ฝ์ ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์•…์˜์ ์ธ ์‚ฌ์šฉ์ž๊ฐ€ HTTP Host ํ—ค๋”๋ฅผ ์กฐ์ž‘ํ•˜์—ฌ ํ”ผ์‹ฑ ์‚ฌ์ดํŠธ๋‚˜ ์•…์„ฑ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ํ˜ธ์ŠคํŒ…๋œ ์„œ๋ฒ„๋กœ์˜ ๋งํฌ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
**Learning:** Next.js์˜ `NextRequest` ๊ฐ์ฒด์—์„œ ์ œ๊ณต๋˜๋Š” `req.nextUrl.origin`์€ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ๋ณด๋‚ธ HTTP Host ํ—ค๋”์˜ ๊ฐ’์— ์˜์กดํ•˜๋ฏ€๋กœ, ์•ˆ์ „ํ•˜์ง€ ์•Š์€ ํ™˜๊ฒฝ(ํŠนํžˆ ์‹ ๋ขฐํ•  ์ˆ˜ ์—†๋Š” ์š”์ฒญ)์—์„œ ์ ˆ๋Œ€์ ์ธ URL์„ ๋งŒ๋“ค ๋•Œ ์‚ฌ์šฉํ•˜๋ฉด ๋ณด์•ˆ ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค.
**Prevention:** ์ ˆ๋Œ€์ ์ธ URL(์˜ˆ: ์ธ์ฆ ์ฝœ๋ฐฑ, ๋น„๋ฐ€๋ฒˆํ˜ธ ์ดˆ๊ธฐํ™” ๋งํฌ ๋“ฑ)์„ ์ƒ์„ฑํ•  ๋•Œ๋Š” ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ œ๊ณตํ•œ ํ—ค๋”(`req.nextUrl.origin` ๋“ฑ)๋ฅผ ์‹ ๋ขฐํ•˜์ง€ ๋ง๊ณ , ๋ฏธ๋ฆฌ ์ •์˜๋œ ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜(์˜ˆ: `process.env.NEXT_PUBLIC_SITE_URL`)๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
## 2024-07-21 - [ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๋ณด์•ˆ ๊ฐ•ํ™” ํ•™์Šต]
**Vulnerability:** ERD ๋ชจ๋ธ์—์„œ ํ…Œ์ด๋ธ”, ์ปฌ๋Ÿผ, ์™ธ๋ž˜ํ‚ค ๋ช…์นญ์— ๋Œ€ํ•œ ๊ธฐ๋ณธ์  ๊ฒ€์ฆ(snake_case)๋งŒ ์กด์žฌํ•˜๋ฉฐ, ์‚ญ์ œ๋‚˜ ๋ณ€๊ฒฝ ๊ฐ™์€ ๊ณ ๊ธ‰ ๊ธฐ๋Šฅ์ด ๋ถ€์žฌ. ์™ธ๋ถ€ ์ž…๋ ฅ์— ๋Œ€ํ•ด ๊ฐ•๊ฑดํ•œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋„ ๋‹ค์†Œ ๋ถ€์กฑํ•  ์ˆ˜ ์žˆ์Œ.
**Learning:** DDL ์ƒ์„ฑ์„ ์œ„ํ•ด ์ž…๋ ฅ๋ฐ›๋Š” ํ…Œ์ด๋ธ”๋ช…๊ณผ ์ปฌ๋Ÿผ๋ช…์— ๋Œ€ํ•ด ์—„๊ฒฉํ•œ ์‹๋ณ„์ž ๊ทœ์น™์„ ์ ์šฉํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ ๊ฒ€์ฆ์ด ๋ฏธํกํ•˜๋ฉด, ํ–ฅํ›„ ๋ณต์žกํ•œ SQL ์ธ์ ์…˜ ๊ณต๊ฒฉ ๋˜๋Š” ์˜ˆ๊ธฐ์น˜ ์•Š์€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์˜ค๋ฅ˜๋ฅผ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Œ.
**Prevention:** ๋ชจ๋“  ์ž…๋ ฅ ์‹๋ณ„์ž์— ๋Œ€ํ•ด ๋ช…ํ™•ํ•œ ๊ฒ€์ฆ(`assertSnakeCaseIdentifier`)์„ ๊ฑฐ์น˜๊ณ , ๋ชจ๋ธ ๋‚ด ์˜์กด์„ฑ ๋ฌด๊ฒฐ์„ฑ์„ ํ›ผ์†ํ•˜๋Š” ์‚ญ์ œ ์ž‘์—…(์ฐธ์กฐ๋˜๋Š” ํ…Œ์ด๋ธ” ์‚ญ์ œ ๋ฐฉ์ง€ ๋“ฑ)์— ๋Œ€ํ•œ ๋ฐฉ์–ด ๋กœ์ง์„ ๋งˆ๋ จํ•ด์•ผ ํ•จ.

## 2026-07-10 - DoS via slow PBKDF2 hashing for environment secrets
**Vulnerability:** Slow PBKDF2 hashing was applied to an in-memory plain text environment variable (`ADMIN_PASSWORD`).
**Learning:** Applying slow cryptographic hashing to secrets originating from and remaining in memory provides zero additional security (since the secret is already accessible) but introduces a critical Denial-of-Service (DoS) risk, as attackers can force the server to execute expensive hash updates.
**Prevention:** Use fast uniform hashes (like SHA-256) when comparing plain text environment secrets to avoid timing attacks, rather than slow key derivation functions like PBKDF2. Always enforce length checking on inputs before hashing.

## 2025-07-08 - [Fix timing attack vulnerability in signature verification]
**Vulnerability:** A custom buffer length check (`if (signatureBytes.length !== expectedSignatureBytes.length) return false`) before calling `crypto.timingSafeEqual()` leaked the length of the expected signature, enabling timing attacks.
**Learning:** Never use custom 'homebrew' buffer-padding logic to match lengths for `crypto.timingSafeEqual()`, as early returns leak the length of the secret.
**Prevention:** Ensure inputs are hashed to a uniform length (e.g., using `crypto.createHash('sha256')`) before comparison.
## 2024-07-21 - [ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๋ฌด๊ฒฐ์„ฑ ๊ฐ•ํ™”]
**Vulnerability:** ERD ๋ชจ๋ธ์— ์‚ญ์ œ ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋  ๊ฒฝ์šฐ ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์ฆ ๋ถ€์žฌ ์‹œ ๋ฐ์ดํ„ฐ ๋ถˆ์ผ์น˜ ๋ฐ ์˜ˆ์™ธ ๋ฐœ์ƒ ๊ฐ€๋Šฅ์„ฑ
**Learning:** `removeTable`์ด๋‚˜ `removeColumn` ๊ฐ™์€ ํŒŒ๊ดด์  ๋™์ž‘ ์‹œ, ํ•ญ์ƒ ํ…Œ์ด๋ธ” ๋‚ด์™ธ์˜ `foreignKeys` ์˜์กด์„ฑ์„ ํ™•์ธํ•˜์—ฌ ์ฐธ์กฐ ์ค‘์ธ ๊ฐ์ฒด์˜ ์‚ญ์ œ๋ฅผ ๋ฐฉ์ง€ํ•ด์•ผ ํ•จ
**Prevention:** ์‚ญ์ œ ์ „ ์˜์กด์„ฑ ํŠธ๋ฆฌ ์Šค์บ” ๋ฐ ์˜ˆ์™ธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๋ฐฉ์–ด์  ์‚ญ์ œ ๋ฉ”์„œ๋“œ ๊ตฌํ˜„ (`removeTable`, `removeColumn`)
Comment on lines +1 to +9
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
### ๐ŸŽจ ๋ณ€๊ฒฝ ์‚ฌํ•ญ (UX / ์ ‘๊ทผ์„ฑ)

- ์›น ๋Œ€์‹œ๋ณด๋“œ์˜ ๊ฐ์ข… ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ(`org-sidebar.tsx`, `org-header.tsx`, `no-organization-state.tsx`)์— ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์šฉ `aria-label="Log out of your account"` (๋˜๋Š” `Sign out of your account`) ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ ‘๊ทผ์„ฑ์„ ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

### ERD ๋„๊ตฌ ๊ธฐ๋Šฅ ํ™•์žฅ ๋ฐ ๋ฌด๊ฒฐ์„ฑ ๊ฐ•ํ™”
- `Column` ์ธํ„ฐํŽ˜์ด์Šค์— `isUnique`, `defaultValue` ์†์„ฑ ์ถ”๊ฐ€
- `removeTable`, `removeColumn`, `removeForeignKey` ๋ฉ”์„œ๋“œ ์ถ”๊ฐ€ ๋ฐ ์‚ญ์ œ ์‹œ ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์ฆ ๋ฐฉ์–ด ๋กœ์ง ๊ตฌํ˜„
- DDL ์ƒ์„ฑ ์‹œ UNIQUE ์ œ์•ฝ ์กฐ๊ฑด ๋ฐ DEFAULT ๊ฐ’ ๊ตฌ๋ฌธ ์ง€์›
- ๊ด€๋ จ๋œ ๋ชจ๋“  ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด 100% ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ๋‹ฌ์„ฑ ๋ฐ ์˜ˆ์™ธ ์ผ€์ด์Šค ์ฒ˜๋ฆฌ
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"@babel/core": "7.29.7",
"esbuild": "0.28.1",
"hono": "4.12.25",
"js-yaml": "4.2.0"
"js-yaml": "4.3.0",
"body-parser": "2.3.0",
"brace-expansion": "1.1.16"
}
}
}
Loading
Loading