π‘οΈ Sentinel: [CRITICAL] Fix CSV Formula Injection in Session Export - #415
π‘οΈ Sentinel: [CRITICAL] Fix CSV Formula Injection in Session Export#415seonghobae wants to merge 1 commit into
Conversation
β¦μ§ μ²λ¦¬ μΆκ° CSV λ€μ΄λ‘λ μ μΈμ νμ΄νμ΄λ λ©μμ§ μλ¬Έμ `=, +, -, @, \t, \r` λ±μ μ€νλ λμνΈ λ§€ν¬λ‘ μ€ν λ¬Έμκ° ν¬ν¨λ κ²½μ°λ₯Ό λλΉνμ¬ ν΄λΉ νλ μμ μμλ°μ΄ν(`'`)λ₯Ό μΆκ°νλ λ°©μ΄ λ‘μ§μ `csvField` ν¨μμ ꡬννμ΅λλ€. μ΄λ₯Ό ν΅ν΄ νΌν΄μκ° λ€μ΄λ‘λ λ°μ CSVλ₯Ό μμ λ±μμ μ΄ λ μμ λͺ λ Ήμ΄κ° μ€νλλ 보μ μ·¨μ½μ μ λ°©μ§ν©λλ€.
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π WalkthroughWalkthroughμΈμ λμ보λ μ‘°ν APIμ CSV λ΄λ³΄λ΄κΈ° νλ¦μ μΆκ°νμ΅λλ€. CSV κ°μ΄ μμ μμ λ¬Έμλ‘ μμνλ©΄ μμλ°μ΄νλ₯Ό λΆμ λλ€. κ΄λ ¨ 보μ κΈ°λ‘κ³Ό ν μ€νΈ κ³νμ κ°±μ νμ΅λλ€. ChangesμΈμ λμ보λ μΈμ μ‘°ν λ° CSV λ΄λ³΄λ΄κΈ°
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
π§Ή Nitpick comments (2)
test_plan.md (1)
3-3: π Security & Privacy | π΅ Trivial | β‘ Quick winμμ μ λμ¬λ³ νκ· ν μ€νΈλ₯Ό ν μ€νΈ κ³νμ μΆκ°νμμμ€.
μ λͺ©κ³Ό 첫 ν둬ννΈμ λν΄
=,+,-,@, ν, μΊλ¦¬μ§ 리ν΄μ κ°κ° κ²μ¦νμμμ€. μΌλ° κ°μ΄ λ³κ²½λμ§ μκ³ μΌν, ν°λ°μ΄ν, μ€λ°κΏμ CSV μ΄μ€μΌμ΄νκ° μ μ§λλμ§λ CSV μλ΅μΌλ‘ κ²μ¦νμμμ€.π€ 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 `@test_plan.md` at line 3, Update the test plan to add regression coverage for formula prefixes in both the title and first prompt, validating values beginning with =, +, -, @, tab, and carriage return. Verify the CSV response preserves ordinary values and continues escaping commas, double quotes, and newlines correctly.packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts.orig (1)
74-78: π Security & Privacy | π΅ Trivial | β‘ Quick winμ·¨μ½ν λ°±μ νμΌμ μμ νμμμ€.
μ΄
csvFieldλ μμ μμ λ¬Έμλ₯Ό μ²λ¦¬νμ§ μμ΅λλ€.buildSessionsCsvλ μ΄ ν¨μλ₯Ό μΈμ μ λͺ©κ³Ό 첫 ν둬ννΈμ μ μ©ν©λλ€. μ΄μ ꡬνμ Git κΈ°λ‘μμ μ‘°ννμμμ€.π€ 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/app/api/orgs/`[orgSlug]/dashboard/sessions/route.ts.orig around lines 74 - 78, Delete the vulnerable backup file containing csvField; do not retain this implementation alongside the active buildSessionsCsv flow. Use the Git history to identify and preserve the prior formula-injection protection in the canonical CSV implementation, ensuring session titles and first prompts remain safely escaped.
π€ 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.
Nitpick comments:
In `@packages/web/src/app/api/orgs/`[orgSlug]/dashboard/sessions/route.ts.orig:
- Around line 74-78: Delete the vulnerable backup file containing csvField; do
not retain this implementation alongside the active buildSessionsCsv flow. Use
the Git history to identify and preserve the prior formula-injection protection
in the canonical CSV implementation, ensuring session titles and first prompts
remain safely escaped.
In `@test_plan.md`:
- Line 3: Update the test plan to add regression coverage for formula prefixes
in both the title and first prompt, validating values beginning with =, +, -, @,
tab, and carriage return. Verify the CSV response preserves ordinary values and
continues escaping commas, double quotes, and newlines correctly.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1be18986-3082-4575-9d73-7ccd2a6b763c
π Files selected for processing (4)
.jules/sentinel.mdpackages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.tspackages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts.origtest_plan.md
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head4097d1e3d073ed0112f50af1ab1f0943d567b506. -
Head SHA:
4097d1e3d073ed0112f50af1ab1f0943d567b506 -
Workflow run: 31338346460
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Test: test_plan.md"]
S2 --> I2["regression suite"]
I2 --> R2["Review risk: Test: test_plan.md"]
R2 --> V2["targeted test run"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage evidence job did not run or did not publish coverage evidence. Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Test: test_plan.md"]
S2 --> I2["regression suite"]
I2 --> R2["Review risk: Test: test_plan.md"]
R2 --> V2["targeted test run"]
|
|
Closing as superseded by #394. The current #394 line covers the same session-export formula-injection cause with a shared production encoder, direct production-helper attack regressions, leading-whitespace/control/full-width prefix coverage, RFC 4180 quoting tests, a bounded export limit, security documentation, and an explicit claim boundary. This PR's narrow route-local matcher and generated |
Understood. Acknowledging that this work is now superseded by #394 and stopping work on this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: μ ν리μΌμ΄μ μμ μ¬μ©μ μ λ ₯ λ°μ΄ν°(μΈμ μ λͺ©μ΄λ ν둬ννΈ μλ¬Έ λ±)λ₯Ό κΈ°λ°μΌλ‘ CSV μ΅μ€ν¬νΈ κΈ°λ₯μ μνν λ, νΉμ μ€νλ λμνΈ κ³΅μ λ¬Έμ(
=,+,-,@,\t,\r)λ‘ μμνλ νλκ° μ μ ν μ΄μ€μΌμ΄νλμ§ μμμ΅λλ€. μ΄λ CSV Formula Injection (Spreadsheet Macro Injection) μ·¨μ½μ μΌλ‘ μ΄μ΄μ§λλ€.π― Impact: μ μμ μΈ μ¬μ©μκ° κ΅λ¬νκ² μ‘°μλ μΈμ μ λͺ©μ΄λ ν둬ννΈλ₯Ό μ μ₯ν λ€, νΌν΄μλ κ΄λ¦¬μκ° ν΄λΉ λ΄μμ CSVλ‘ λ€μ΄λ‘λνμ¬ μμ κ³Ό κ°μ μ€νλ λμνΈ νλ‘κ·Έλ¨μμ μ΄λ©΄ λ‘컬 μμ€ν μμ μμμ λͺ λ Ήμ΄(λ§€ν¬λ‘)κ° μ€νλ μ μμ΅λλ€.
π§ Fix: CSV νλ λ³νμ λ΄λΉνλ
csvFieldν¨μμ μ κ·μμ νμ©ν κ²μ¦ λ‘μ§μ μΆκ°νμ΅λλ€. νλκ° μν λ¬Έμλ‘ μμνλ κ²½μ°, κ° μμ μμλ°μ΄ν(')λ₯Ό μλμΌλ‘ μΆκ°νμ¬ μ€νλ λμνΈ νλ‘κ·Έλ¨μ΄ μ΄λ₯Ό μμ(Formula)μ΄ μλ μΌλ° λ¬Έμμ΄(Text)λ‘ κ°μ μΈμνλλ‘ μμ νμ΅λλ€.β Verification: ν μ€νΈ(
pnpm test --coverage)λ₯Ό λͺ¨λ ν΅κ³ΌνμΌλ©°, μ§μ packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.tsμ λν μ μ©μ νμΈνμ΅λλ€.Sentinel μ λ(
jules/sentinel.md)μ ν΄λΉ μ·¨μ½μ μ λν λ°°μ λ° λ°©μ΄ ν¨ν΄μ μ±κ³΅μ μΌλ‘ κΈ°λ‘νμ΅λλ€.PR created automatically by Jules for task 18236748083180255918 started by @seonghobae
Summary by CodeRabbit
보μ κ°μ
λ¬Έμν