Skip to content

fix(privacy): sanitize review comments before DB write#73

Merged
Ashish-Kumar-Dash merged 1 commit into
OpenLake:mainfrom
roshanraj9136:fix/sanitize-review-comments
Jun 13, 2026
Merged

fix(privacy): sanitize review comments before DB write#73
Ashish-Kumar-Dash merged 1 commit into
OpenLake:mainfrom
roshanraj9136:fix/sanitize-review-comments

Conversation

@roshanraj9136

Copy link
Copy Markdown
Contributor

Problem

AddReviewButton and AddReviewButtonProfessor write user-submitted comments directly to the reviews table without sanitization. If a student types their email, phone number, name, or student ID into a review, that PII is stored verbatim — defeating the anonymization design.

enhancedSanitizeContent already exists in src/lib/anonymization.ts and handles all these cases, but it was never called on the write path.

Fix

Import and call enhancedSanitizeContent(comment) before the Supabase .update() in both components.

Files changed (2)

  • src/components/courses/AddReviewButton.tsx
  • src/components/professors/AddReviewButtonProfessor.tsx

Verified

  • tsc --noEmit clean
  • No other files touched

AddReviewButton and AddReviewButtonProfessor were writing user
comments directly to the reviews table without calling
enhancedSanitizeContent. This meant emails, phone numbers, student
IDs, names, and other PII typed into reviews would persist in the
database verbatim, defeating the anonymization design.

Wire enhancedSanitizeContent into both submission paths so PII is
stripped before the Supabase insert/update.
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

@roshanraj9136 is attempting to deploy a commit to the OpenLake_Website Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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

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

⌛ 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: 8ecf16e9-7594-410d-aa27-1c9b3dd3c07e

📥 Commits

Reviewing files that changed from the base of the PR and between cd02e34 and 57d804c.

📒 Files selected for processing (2)
  • src/components/courses/AddReviewButton.tsx
  • src/components/professors/AddReviewButtonProfessor.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@Ashish-Kumar-Dash Ashish-Kumar-Dash merged commit 46dde5b into OpenLake:main Jun 13, 2026
1 of 2 checks passed
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