Skip to content

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] Fix hardcoded admin password vulnerability#23

Closed
seonghobae wants to merge 4 commits into
mainfrom
sentinel-fix-hardcoded-admin-password-13080653383541791497
Closed

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] Fix hardcoded admin password vulnerability#23
seonghobae wants to merge 4 commits into
mainfrom
sentinel-fix-hardcoded-admin-password-13080653383541791497

Conversation

@seonghobae

Copy link
Copy Markdown

๐Ÿšจ Severity: CRITICAL
๐Ÿ’ก Vulnerability: A hardcoded admin password was found embedded in the source code (packages/web/src/lib/server/admin-auth.ts), which is a major security flaw allowing attackers to bypass authentication.
๐ŸŽฏ Impact: Attackers who have access to the repository, its historical commits, or derived client/server bundles could potentially extract the hardcoded password and impersonate administrative capabilities.
๐Ÿ”ง Fix: Removed the hardcoded value and introduced ADMIN_PASSWORD into the environment variable Zod schema (env.ts). verifyAdminCredentials now verifies against env.ADMIN_PASSWORD. Updated .env.example and CI workflow configurations.
โœ… Verification: Ensure the .env file has an ADMIN_PASSWORD defined, then run pnpm --filter @argos/web build. The CI should pass successfully and attempting to login without the newly set ADMIN_PASSWORD should reject authorization.


PR created automatically by Jules for task 13080653383541791497 started by @seonghobae

Removed hardcoded `ADMIN_PASSWORD` from `admin-auth.ts` and migrated it to be strictly managed via environment variables to prevent accidental leaks. Updated validation schema, `.env.example`, and CI pipelines to support this change.
@google-labs-jules

Copy link
Copy Markdown

๐Ÿ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a ๐Ÿ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 17 minutes and 45 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

โŒ› How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

๐Ÿšฆ How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

โ„น๏ธ Review info
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 81ad6b92-2382-42e5-9598-a1c7fc60ffaa

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between f4a09a0 and c51608e.

๐Ÿ“’ Files selected for processing (1)
  • packages/web/src/lib/server/admin-auth.ts
๐Ÿ“ Walkthrough

๊ฐœ์š”

ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๊ด€๋ฆฌ์ž ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์ด๊ด€ํ•˜๊ณ  Zod ์Šคํ‚ค๋งˆ๋ฅผ ํ†ตํ•ด ๊ฒ€์ฆํ•˜๋„๋ก ๊ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์ • ํŒŒ์ผ๊ณผ CI ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํ•จ๊ป˜ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ์ผ๊ด€๋œ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ด€๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.

๋ณ€๊ฒฝ์‚ฌํ•ญ

๊ด€๋ฆฌ์ž ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜

๊ณ„์ธต / ํŒŒ์ผ ์š”์•ฝ
ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์Šคํ‚ค๋งˆ ์ •์˜ ๋ฐ ์ธ์ฆ ๋กœ์ง ์—…๋ฐ์ดํŠธ
packages/web/src/lib/server/env.ts, packages/web/src/lib/server/admin-auth.ts
EnvSchema์— ADMIN_PASSWORD ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ trim ํ›„ ์ตœ์†Œ 8์ž ๊ฒ€์ฆ์„ ๊ฐ•์ œํ•ฉ๋‹ˆ๋‹ค. ๊ด€๋ฆฌ์ž ์ธ์ฆ ๋ชจ๋“ˆ์—์„œ ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ƒ์ˆ˜๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ธฐ๋ฐ˜ ๋น„๋ฐ€๋ฒˆํ˜ธ ๋น„๊ต๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ • ๋ฐ CI ์—…๋ฐ์ดํŠธ
packages/web/.env.example, .github/workflows/ci.yml, .jules/sentinel.md
์˜ˆ์‹œ ํ™˜๊ฒฝ ํŒŒ์ผ์— ADMIN_PASSWORD ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€ํ•˜๊ณ , CI ์›Œํฌํ”Œ๋กœ์šฐ ๋นŒ๋“œ ์Šคํ…์— ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๋ณด์•ˆ ํ•™์Šต ์ž๋ฃŒ์— ํ•˜๋“œ์ฝ”๋”ฉ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ œ๊ฑฐ ๋ฐ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๊ด€๋ฆฌ ์ง€์นจ์„ ๋ฌธ์„œํ™”ํ•ฉ๋‹ˆ๋‹ค.

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~8๋ถ„

๐Ÿฐ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ˆจ๊ธ€์ค„ ์ƒˆ๋กœ์›Ÿ๋„ค!
ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์•ˆ์ „ํ•˜๊ฒŒ ๋ณด๊ด€ํ•˜๊ณ 
์Šคํ‚ค๋งˆ๋กœ ๊ฒ€์ฆํ•˜๋‹ˆ ์ผ์„์ด์กฐ
ํ•˜๋“œ์ฝ”๋”ฉ์€ ์ด์ œ ์•ˆ๋…•! ๐Ÿ‘‹


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

โŒ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage โŒ Error Docstring coverage is 0.00% which is insufficient. The required threshold is 100.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check name Status Explanation
Title check โœ… Passed PR ์ œ๋ชฉ์ด ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ธ ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๊ด€๋ฆฌ์ž ๋น„๋ฐ€๋ฒˆํ˜ธ ์ทจ์•ฝ์  ์ˆ˜์ •์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์š”์•ฝํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
Description check โœ… Passed PR ์„ค๋ช…์ด ๋ณ€๊ฒฝ ์‚ฌํ•ญ๊ณผ ๊ด€๋ จ์ด ์žˆ์œผ๋ฉฐ, ์ทจ์•ฝ์ , ์˜ํ–ฅ, ์ ์šฉ๋œ ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ ๊ฒ€์ฆ ๋‹จ๊ณ„๋ฅผ ์ƒ์„ธํžˆ ์„ค๋ช…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
Linked Issues check โœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check โœ… Passed Check skipped because no linked issues were found for this pull request.
โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-fix-hardcoded-admin-password-13080653383541791497
โœจ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch sentinel-fix-hardcoded-admin-password-13080653383541791497

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and canโ€™t be posted inline due to platform limitations.

โš ๏ธ Outside diff range comments (1)
packages/web/src/lib/server/env.ts (1)

1-11: โš ๏ธ Potential issue | ๐ŸŸ  Major | โšก Quick win

๋ณด์•ˆ ๊ฒฝ๊ณ„ ๊ฐ•ํ™”๋ฅผ ์œ„ํ•ด packages/web/src/lib/server/env.ts์— import 'server-only' ์ถ”๊ฐ€

env.ts๊ฐ€ process.env์—์„œ ์‹œํฌ๋ฆฟ์„ ํŒŒ์‹ฑํ•ด exportํ•˜์ง€๋งŒ server-only ๊ฐ€๋“œ๊ฐ€ ์—†์–ด, ์‹ค์ˆ˜๋กœ ํด๋ผ์ด์–ธํŠธ ๋ฒˆ๋“ค๋กœ ์ „ํŒŒ๋  ์—ฌ์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. server-only๋ฅผ ํŒŒ์ผ ์ตœ์ƒ๋‹จ์— ์ถ”๊ฐ€ํ•˜๋ฉด Next.js์—์„œ Client Component(๋˜๋Š” ํŠธ๋žœ์ง€ํ‹ฐ๋ธŒ import)๊ฐ€ ํ•ด๋‹น ๋ชจ๋“ˆ์„ ๊ฐ€์ ธ์˜ค๋ ค ํ•  ๋•Œ ๋นŒ๋“œ ๋‹จ๊ณ„์—์„œ ์ฐจ๋‹จ๋˜์–ด ๋” ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ”’ ์ œ์•ˆ ์ˆ˜์ •์•ˆ
+import 'server-only'
 import { z } from 'zod'
๐Ÿค– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/web/src/lib/server/env.ts` around lines 1 - 11, Add the Next.js
server-only guard to this module so it cannot be accidentally bundled to the
client: at the top of packages/web/src/lib/server/env.ts import 'server-only'
before any other code, then keep the existing EnvSchema and export const env =
EnvSchema.parse(process.env) as-is; this ensures the module (and its secrets
parsed by EnvSchema/env) will be rejected from client components or transitive
client imports.
๐Ÿค– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/web/src/lib/server/env.ts`:
- Around line 1-11: Add the Next.js server-only guard to this module so it
cannot be accidentally bundled to the client: at the top of
packages/web/src/lib/server/env.ts import 'server-only' before any other code,
then keep the existing EnvSchema and export const env =
EnvSchema.parse(process.env) as-is; this ensures the module (and its secrets
parsed by EnvSchema/env) will be rejected from client components or transitive
client imports.

โ„น๏ธ Review info
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: beb0d081-35cb-4938-8482-e709aa35414c

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between cdf4ce8 and f4a09a0.

๐Ÿ“’ Files selected for processing (5)
  • .github/workflows/ci.yml
  • .jules/sentinel.md
  • packages/web/.env.example
  • packages/web/src/lib/server/admin-auth.ts
  • packages/web/src/lib/server/env.ts

Removed hardcoded `ADMIN_PASSWORD` from `admin-auth.ts` and migrated it to be strictly managed via environment variables to prevent accidental leaks. Updated validation schema, `.env.example`, and CI pipelines to support this change.
โ€ฆed HMAC keys

Modified `safeEqual` in `admin-auth.ts` to first pre-hash the password inputs before using them as HMAC keys. This securely prevents HMAC key padding collisions while correctly maintaining a timing-safe equality check and satisfying CodeQL's secret tracking requirements.
Comment thread packages/web/src/lib/server/admin-auth.ts Fixed
Comment thread packages/web/src/lib/server/admin-auth.ts Fixed
Refactored `verifyAdminCredentials` to compute a `pbkdf2Sync` hash of the targets at module initialization. By avoiding plain hashing algorithms (like sha256) and using a proper key derivation function, CodeQL is satisfied. Pre-computing the target hashes ensures the single-threaded Node.js event loop isn't overly blocked during each request, balancing security requirements with DoS prevention.
@seonghobae

Copy link
Copy Markdown
Author

์ด ๋ณ€๊ฒฝ์€ upstream vibemafiaclub/argos#19๋กœ ์ด๋ฏธ ๋ฐ˜์˜๋œ hardcoded admin credential ์ œ๊ฑฐ์™€ ์ค‘๋ณต์ž…๋‹ˆ๋‹ค. ์ตœ์‹  upstream/main ๊ธฐ์ค€ 26๊ฐœ ํŒŒ์ผ์˜ stale diff์™€ .jules ๋‚ด๋ถ€ ํŒŒ์ผ์„ ํฌํ•จํ•˜๊ณ , ๋ณด์•ˆ/CI ๋ณ€๊ฒฝ์„ ๋˜๋Œ๋ฆด ์œ„ํ—˜์ด ์žˆ์–ด ๋‹ซ์Šต๋‹ˆ๋‹ค.

@seonghobae seonghobae closed this Jun 5, 2026
@google-labs-jules

Copy link
Copy Markdown

์ด ๋ณ€๊ฒฝ์€ upstream vibemafiaclub/argos#19๋กœ ์ด๋ฏธ ๋ฐ˜์˜๋œ hardcoded admin credential ์ œ๊ฑฐ์™€ ์ค‘๋ณต์ž…๋‹ˆ๋‹ค. ์ตœ์‹  upstream/main ๊ธฐ์ค€ 26๊ฐœ ํŒŒ์ผ์˜ stale diff์™€ .jules ๋‚ด๋ถ€ ํŒŒ์ผ์„ ํฌํ•จํ•˜๊ณ , ๋ณด์•ˆ/CI ๋ณ€๊ฒฝ์„ ๋˜๋Œ๋ฆด ์œ„ํ—˜์ด ์žˆ์–ด ๋‹ซ์Šต๋‹ˆ๋‹ค.

Understood. Acknowledging that this work is a duplicate of upstream and the PR is now closed. Stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants