Skip to content

fix(api): neutralize formula injection in the issue export#354

Open
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/export-formula-injection
Open

fix(api): neutralize formula injection in the issue export#354
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/export-formula-injection

Conversation

@cavidelizade

Copy link
Copy Markdown
Contributor

Summary

Issue, project and state names were written straight into spreadsheet cells, so a work item title like =HYPERLINK(...), +cmd, -2+3 or @SUM(...) became a live formula when the exported .xlsx was opened in Excel, LibreOffice or Sheets. Titles are user-controlled, so anyone who can create an issue could plant one and whoever exported and opened the file would trigger it.

Linked issues

Closes #331

Type of change

  • Bug fix (fix:)

Surface

  • API (apps/api/)

What changed

Added neutralizeFormula, which prefixes any cell text starting with =, +, -, @, tab or CR with a single quote so the spreadsheet treats it as literal text. Applied it to every cell value in the workbook builder. Non-string values pass through untouched.

Test plan

  • go build, go vet, go test ./... green, including the new TestNeutralizeFormula

AI assistance

  • AI tools were used, tool(s): Claude Code (Opus 4.8), commits carry a Co-Authored-By: trailer

Issue, project and state names were written straight into spreadsheet cells, so
a title like =HYPERLINK(...), +cmd, -2+3 or @sum(...) became a live formula when
the exported .xlsx was opened. Titles are user-controlled, so this was a
stored-then-exported injection.

Prefix any cell text that starts with =, +, -, @, tab or CR with a single
quote so it's treated as literal text.

Closes Devlaner#331

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cavidelizade
cavidelizade requested a review from a team as a code owner July 16, 2026 20:11
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 49 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: 5e55b829-a16e-4fb1-b3a2-e731f7696259

📥 Commits

Reviewing files that changed from the base of the PR and between 61bc903 and 9793256.

📒 Files selected for processing (2)
  • apps/api/internal/service/export.go
  • apps/api/internal/service/export_formula_test.go
✨ 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.

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.

Issue export is vulnerable to CSV/spreadsheet formula injection

1 participant