Skip to content

[Payment due @cretadn22] Upgrade xlsx to 0.20.3 to fix security vulnerabilities - #103028

Merged
cristipaval merged 2 commits into
mainfrom
claude-upgradeXlsxSecurity
Oct 6, 2026
Merged

cristipaval merged 2 commits into
mainfrom
claude-upgradeXlsxSecurity

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Upgrades xlsx (SheetJS) 0.18.5 → 0.20.3. Fixes both open Dependabot alerts: Prototype Pollution (GHSA-4r6h-8v6p-xvw6, fixed in 0.19.3) and ReDoS (GHSA-5pgg-2g8v-p4x9, fixed in 0.20.2).

SheetJS stopped publishing to npm after 0.18.5, so the dependency now points at the official SheetJS CDN tarball (their documented install method). 0.20.x bundles its old sub-deps (adler-32, cfb, codepage, crc-32, frac, ssf, wmf, word), so those drop out of the lockfile.

Usage: Only in ImportSpreadsheet.tsx:144-166, which lazy-loads xlsx to parse user-uploaded CSV/XLS/XLSX files (XLSX.read + sheet_to_json) for spreadsheet imports: categories, tags (incl. multi-level), members, per diem, workflows, merchant rules, company cards, and personal card transactions.

Risk: 0.20.0 changed how date cells are interpreted in UTC. sheet_to_json still returns dates that are correct in local time by default, so the app's local format() call is unaffected. Verified locally: an XLSX date cell read with the app's options formats to the same calendar day in UTC−11 through UTC+14, including across DST.

Change Log

From the SheetJS CHANGELOG:

  • 0.20.3 – Fix NUMBERS/ODS merge-cell parsing; more precise Infinity/NaN handling; XLML streaming write; parse Int8Array; CSV export only quotes leading ID
  • 0.20.2 – Reworked parsing to avoid slow regexes (CVE-2024-22363); HTML encodes data-v; SYLK error cells
  • 0.20.1 – SSF date rounding to 15 digits; sheet_to_json forces UTC for formatted strings; non-compliant XLSX merge cells; dense type; mini/core export map entries
  • 0.20.0 – UTC interpretation of Date objects for date cells (potentially breaking); UTC/local options on API functions; export NaN → #NUM!, Infinity → #DIV/0!
  • 0.19.3 – Prototype Pollution fix (CVE-2023-30533); valid comment addresses; enforce sheet-name rules
  • 0.19.2 – XLSX hyperlink decoding; ignore unexpected rich-text attributes; sheet_to_json type fix
  • 0.19.1 – Strict-mode type fix; NUMBERS 12.2 parsing
  • 0.19.0 – Google Sheets–compatible hyperlinks; NUMBERS multi-sheet export; formalized dense mode

AI Tests: npm ci succeeds with the updated lockfile; tsc --noEmit passes; ImportSpreadsheetTest passes; ad-hoc check of CSV/XLSX parsing (incl. dates across 7 time zones) passes. Other related Jest suites couldn't load in the sandbox (Node 24 vs required Node 26 ESM support), unrelated to this change.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/688729
PROPOSAL:

Tests

  1. Workspace > Categories > More > Import spreadsheet. Upload a .csv. Verify columns/rows show and import succeeds.
  2. Repeat with an .xlsx and an .xls file (Tags or Members). Verify data shows correctly.
  3. Workspace > Company cards > Add cards > CSV import. Upload an .xlsx with a date column (Excel date format). Verify dates show as the correct day, not shifted by one. Repeat with your device set to a UTC− time zone (for example, US Pacific).
  4. Account > Wallet > personal card import: upload a CSV with dates like 2026-01-15 and 01/16/2026. Verify values are kept as-is.
  5. Upload a multi-level tags .xlsx. Verify import succeeds.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@MelvinBot
MelvinBot requested a review from a team as a code owner October 5, 2026 12:40
@melvin-bot
melvin-bot Bot requested review from cretadn22 and removed request for a team October 5, 2026 12:40
@melvin-bot

melvin-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

@cretadn22 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing test (job 1) check is unrelated to this PR, so I didn't push a change. Rerun it once the test is fixed on main.

Analysis: tests/unit/hooks/useGettingStartedItems.test.ts fails with ReferenceError: Request is not defined. The error comes from an unmocked API call in src/libs/HttpUtils.ts:118 reaching expo's fetch polyfill in Jest. This PR only changes the xlsx package, which neither file uses.

Evidence
  • Files changed in this PR: package.json and package-lock.json. Only ImportSpreadsheet.tsx uses xlsx.
  • Failing tests: 9 tests under row 4 - Set up spend rules and item ordering.
  • Every Jest run started since about 12:37 UTC today fails on this same test with the same error, including runs on unrelated branches: feat/oxlint, claude-updateUndici, claude-bumpPdfjsDist, claude-bumpFastXmlParser, and claude-fixImageSizeVulnerability.
  • Check independent approval is also failing. It's a process check that clears once a reviewer approves, not a code failure.

view run

@cretadn22

cretadn22 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-10-06.at.00.28.43.mov
Android: mWeb Chrome
Screen.Recording.2026-10-05.at.23.59.25.mov
iOS: HybridApp
Screen.Recording.2026-10-06.at.00.28.21.mov
iOS: mWeb Safari
Screen.Recording.2026-10-06.at.00.00.38.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-05.at.23.48.01.mov

@cretadn22

Copy link
Copy Markdown
Contributor

It seems this test is already failing on main

@cretadn22

Copy link
Copy Markdown
Contributor

@MelvinBot Looks good! Could you please merge the latest main?

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I didn't merge main into this branch. Merging pushes a new commit, so it counts as a code change.

I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author should reply with a request tagging me.

@cristipaval, should I merge the latest main into this PR?


view run

@melvin-bot
melvin-bot Bot requested a review from cristipaval October 5, 2026 17:49
@melvin-bot melvin-bot Bot changed the title Upgrade xlsx to 0.20.3 to fix security vulnerabilities [Payment due @cretadn22] Upgrade xlsx to 0.20.3 to fix security vulnerabilities Oct 5, 2026
@melvin-bot

melvin-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎯 @cretadn22, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/688729.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@cretadn22

Copy link
Copy Markdown
Contributor

@cristipaval Everything looks good. Can you ask Melvin to merge the latest main and update the author checklist?

…urity

Co-authored-by: Cristi Paval <cristipaval@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I merged the latest main into this branch (f724625). That should fix the failing test (job 1) check.

The test failed because of a problem on main, not this PR. main fixed it in [No QA] Mock fetch in useGettingStartedItems tests so GetRules stays off the network. The merge was clean, and this PR still changes only package.json and package-lock.json. CI will rerun the tests on the new commit.

I didn't check off the PR Author Checklist, so the checklist check still fails. Most items confirm manual testing on each platform, which I haven't done. cristipaval, please check them off once that testing is done. Check independent approval will pass after an approval.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing Build iOS HybridApp check is a CI network error, not a problem with this PR, so I didn't push a change. Please rerun the failed job. I couldn't rerun it myself.

Analysis: The iOS archive built successfully. The job failed afterward, in the Rock Remote Build - iOS step, while uploading the built .ipa to the S3 remote cache. The runner couldn't resolve the S3 host:

Error: getaddrinfo ENOTFOUND ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com
Evidence
  • This PR only changes package.json and package-lock.json to upgrade xlsx. There are no native iOS changes.
  • The build log has no compiler errors. The failure happens after the rock remote-cache upload command starts.
  • test (job 1) now passes after the latest main merge.
  • Check independent approval is a process check. It clears once a reviewer approves.

view run

@cristipaval
cristipaval merged commit 8562a6b into main Oct 6, 2026
52 of 55 checks passed
@cristipaval
cristipaval deleted the claude-upgradeXlsxSecurity branch October 6, 2026 07:42
@OSBotify

OSBotify commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify OSBotify mentioned this pull request Oct 6, 2026
100 tasks done
@OSBotify

OSBotify commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.5.4-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@jponikarchuk

Copy link
Copy Markdown

This PR failing because of the issue #103328
This issue is reproducible in: All platforms

@melvin-bot

melvin-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #103373

@OSBotify

OSBotify commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

6 participants