Repository navigation
π‘οΈ Sentinel: [MEDIUM] CSV μμ μ£Όμ μ·¨μ½μ μμ - #792
seonghobae wants to merge 2 commits into
Conversation
|
π 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. |
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review info
π Walkthrough
Merge Risk: βͺ Minimal Β· up to The session export applies the documented formula-injection protection to its data fields while retaining CSV escaping. No actionable merge-blocking risk is established; the change is ready for normal checks. Pre-merge checks |
|
| import { NextRequest, NextResponse } from "next/server"; | ||
| import type { PaginatedResult, SessionItem } from "@argos/shared"; | ||
| import { Prisma } from "@prisma/client"; | ||
| import { db } from "@/lib/server/db"; | ||
| import { requireAuth } from "@/lib/server/auth-helper"; | ||
| import { handleRouteError } from "@/lib/server/error-helper"; | ||
| import { parseDateRange, parsePagination } from "@/lib/server/dashboard"; |
There was a problem hiding this comment.
| if (typeof value !== "number") { | ||
| if (/^\s*[=+\-@\t\r\nοΌοΌοΌοΌ ]/.test(text)) { | ||
| text = "'" + text; | ||
| } | ||
| } | ||
|
|
||
| return /[",\r\n]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text; |
π¨ Severity: MEDIUM
π‘ Vulnerability: μ¬μ©μκ° μ μ΄ν μ μλ κ°μ΄ CSVλ‘ λ΄λ³΄λ΄μ§ λ,
=,+,-,@λ±μΌλ‘ μμνλ κ²½μ° μ€νλ λμνΈ λ§€ν¬λ‘ μΈμ μ (CSV Formula Injection)μ΄ λ°μν μ μμ΅λλ€.π― Impact: νΌν΄μκ° μμ μ΄λ μ€νλ λμνΈ νλ‘κ·Έλ¨μμ μ΄ CSV νμΌμ μ΄ λ μμμ λͺ λ Ήμ΄κ° μ€νλκ±°λ λ―Όκ°ν λ°μ΄ν°κ° μ μΆλ μ μμ΅λλ€.
π§ Fix: μ«μ νμ μ΄ μλ λ¬Έμμ΄ κ°μ΄
=,+,-,@λ° μ κ° λ¬Έμ λ± μμ λ¬Έμλ€λ‘ μμν κ²½μ° μμ μμ λ°μ΄ν(')λ₯Ό λΆμ¬ μμμ΄ μλ μΌλ° ν μ€νΈλ‘ μΈμλλλ‘ μμ νμ΅λλ€.β Verification:
pnpm testλ°pnpm lintλ₯Ό μ€ννμ¬ 100% ν μ€νΈ 컀λ²λ¦¬μ§ λ° μ μ λμμ νμΈνμ΅λλ€.PR created automatically by Jules for task 3241748385914271158 started by @seonghobae
Summary by CodeRabbit