Skip to content

πŸ›‘οΈ Sentinel: [MEDIUM] Fix CSV Injection vulnerability - #394

Open
seonghobae wants to merge 12 commits into
developmentalfrom
sentinel/fix-csv-injection-120765243293811338
Open

πŸ›‘οΈ Sentinel: [MEDIUM] Fix CSV Injection vulnerability#394
seonghobae wants to merge 12 commits into
developmentalfrom
sentinel/fix-csv-injection-120765243293811338

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 5, 2026

Copy link
Copy Markdown

🚨 Severity: MEDIUM

πŸ’‘ Vulnerability

μ‚¬μš©μžκ°€ μž…λ ₯ν•œ 데이터가 μ μ ˆν•œ μ΄μŠ€μΌ€μ΄ν•‘μ΄λ‚˜ 검증 없이 CSV 파일둜 λ‚΄λ³΄λ‚΄μ–΄μ§ˆ λ•Œ CSV μΈμ μ…˜ 취약점이 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

🎯 Impact

μ‚¬μš©μžκ°€ μ•…μ˜μ μΈ νŽ˜μ΄λ‘œλ“œλ₯Ό μž…λ ₯ν•˜μ—¬ μ—‘μ…€κ³Ό 같은 μŠ€ν”„λ ˆλ“œμ‹œνŠΈ ν”„λ‘œκ·Έλž¨μ—μ„œ ν•΄λ‹Ή CSV νŒŒμΌμ„ μ—΄λ©΄ 원격 μ½”λ“œκ°€ μ‹€ν–‰λ˜κ±°λ‚˜ μ€‘μš” 정보가 유좜될 수 μžˆμŠ΅λ‹ˆλ‹€.

πŸ”§ Fix

csvField ν•¨μˆ˜μ— =, +, -, @ 기호둜 μ‹œμž‘ν•˜λŠ” κ°’ μ•žμ— μž‘μ€λ”°μ˜΄ν‘œ(')λ₯Ό μΆ”κ°€ν•˜μ—¬ μŠ€ν”„λ ˆλ“œμ‹œνŠΈ ν”„λ‘œκ·Έλž¨μ—μ„œ μˆ˜μ‹μ΄ μ•„λ‹Œ ν…μŠ€νŠΈλ‘œ μΈμ‹ν•˜κ²Œ λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€.

βœ… Verification

  1. packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts νŒŒμΌμ—μ„œ csvField ν•¨μˆ˜κ°€ μˆ˜μ •λ˜μ—ˆλŠ”μ§€ 확인.
  2. =, +, -, @둜 μ‹œμž‘ν•˜λŠ” 값을 μž…λ ₯ν–ˆμ„ λ•Œ ν…μŠ€νŠΈλ‘œ μ²˜λ¦¬λ˜λŠ”μ§€ ν…ŒμŠ€νŠΈλ₯Ό μΆ”κ°€ν•˜μ—¬ 확인.
  3. pnpm test λͺ…λ Ήμ–΄λ₯Ό 톡해 ν”„λ‘œμ νŠΈ λ‚΄ ν…ŒμŠ€νŠΈ μŠ€μœ„νŠΈκ°€ 정상 λ™μž‘ν•˜κ³  컀버리지 λͺ©ν‘œκ°€ μΆ©μ‘±λ˜λŠ”μ§€ 확인 μ™„λ£Œ.

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

Summary by CodeRabbit

  • λ³΄μ•ˆ

    • CSV 내보내기 μ‹œ μˆ˜μ‹μœΌλ‘œ 해석될 수 μžˆλŠ” μž…λ ₯을 μ•ˆμ „ν•˜κ²Œ μ²˜λ¦¬ν•΄ CSV μΈμ μ…˜ μœ„ν—˜μ„ μ€„μ˜€μŠ΅λ‹ˆλ‹€.
    • 특수문자, λ”°μ˜΄ν‘œ, μ‰Όν‘œ, μ€„λ°”κΏˆ 및 λ‹€μ–‘ν•œ μˆ˜μ‹ 접두사 μž…λ ₯을 μ•ˆμ „ν•˜κ²Œ μ΄μŠ€μΌ€μ΄ν”„ν•©λ‹ˆλ‹€.
  • ν…ŒμŠ€νŠΈ

    • 일반 κ°’, 숫자, 빈 κ°’κ³Ό μ•…μ„± μž…λ ₯을 ν¬ν•¨ν•œ CSV 내보내기 λ™μž‘ 검증을 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.
  • λ¬Έμ„œ

    • CSV μΈμ μ…˜ 취약점과 μ•ˆμ „ν•œ 처리 방법을 λ¬Έμ„œν™”ν–ˆμŠ΅λ‹ˆλ‹€.

@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 Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 387ffb87-8f90-4a8b-af56-817ccb4ca1b2

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between b715ebd and 84bd522.

πŸ“’ Files selected for processing (7)
  • .jules/sentinel.md
  • CHANGELOG.md
  • docs/doctoring/csv-formula-injection-boundary.md
  • osv-scanner.toml
  • packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts
  • packages/web/src/lib/csv-export.security.test.ts
  • packages/web/src/lib/csv-export.ts
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel/fix-csv-injection-120765243293811338

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

@opencode-agent opencode-agent 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.

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 success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before 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 head b732363f7e76222252b20b45aae59c3899e70c22.

  • Head SHA: b732363f7e76222252b20b45aae59c3899e70c22

  • Workflow run: 31071589231

  • 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"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 6, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 84bd522ae239f03a1ac0b71c78eecd681526e723
  • Workflow run: 31171428976
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

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 success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before 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 head 84bd522ae239f03a1ac0b71c78eecd681526e723.

  • Head SHA: 84bd522ae239f03a1ac0b71c78eecd681526e723

  • Workflow run: 31171428976

  • 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 (6 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (6 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: csv-formula-injection-boundary.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: csv-formula-injection-boundary.md"]
  R2 --> V2["docs review"]
Loading

Copy link
Copy Markdown
Author

@coderabbitai review
@cwl-noema-review
@opencode-agent

Review the exact live head only. Verify CSV formula injection is mitigated for every spreadsheet-triggering prefix after relevant leading whitespace/control normalization, quoting remains RFC 4180-compatible, ordinary negative numbers and intentional data are handled according to the documented export policy, and executable regression fixtures cover Excel/LibreOffice-relevant cases without claiming remote-code execution automatically. Require current tests, configured coverage, security gates, doctoring/CHANGELOG, and zero unresolved threads. Review only; do not update the branch, merge, release, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 11 minutes and 2 seconds before sending another message.

@seonghobae
seonghobae enabled auto-merge (squash) August 7, 2026 00:42
@opencode-agent
opencode-agent Bot disabled auto-merge August 7, 2026 03:18
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@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.

Actionable comments posted: 2

πŸ€– 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.

Inline comments:
In @.jules/sentinel.md:
- Around line 24-27: Update the CSV Injection Vulnerability entry in
sentinel.md: revise the threat description to cover formula execution,
external-link or data-lookup prompting, and explicitly clarify that CSV formula
interpretation alone does not imply automatic remote code execution. Expand the
prevention policy to require checking leading whitespace and control characters
before neutralizing values beginning with =, +, -, or @.

In `@packages/web/src/app/api/orgs/`[orgSlug]/dashboard/sessions/route.ts:
- Around line 76-80: Replace the local csvField logic in
packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts:76-80 with
the shared encodeCsvField import from `@/lib/csv-export`, ensuring session CSV
fields use the common security contract. In
packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.test.ts:3-45,
remove the duplicated encoder and either import encodeCsvField or validate the
actual CSV response.
πŸͺ„ Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c551db0e-665e-47d6-aecd-f470dadfd97e

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 4f8796e and b715ebd.

πŸ“’ Files selected for processing (4)
  • .jules/sentinel.md
  • packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.test.ts
  • packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts
  • packages/web/src/lib/csv-export.security.test.ts

Comment thread .jules/sentinel.md Outdated
Comment thread packages/web/src/app/api/orgs/[orgSlug]/dashboard/sessions/route.ts Outdated
seonghobae added a commit that referenced this pull request Aug 7, 2026
* Cleaned up the local branch and working tree as this PR was closed and superseded by a more comprehensive fix in #394.

@opencode-agent opencode-agent 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.

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 success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before 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 head 84bd522ae239f03a1ac0b71c78eecd681526e723.

  • Head SHA: 84bd522ae239f03a1ac0b71c78eecd681526e723

  • Workflow run: 31171428976

  • 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 (6 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (6 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs: csv-formula-injection-boundary.md"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs: csv-formula-injection-boundary.md"]
  R2 --> V2["docs review"]
Loading

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.

1 participant