Skip to content

[Payment due @daledah] Upgrade metro to 0.84.5 and image-size to 2.0.4 to fix Dependabot alerts - #103025

Merged
NikkiWines merged 2 commits into
mainfrom
claude-fixImageSizeVulnerability
Oct 6, 2026
Merged

NikkiWines merged 2 commits into
mainfrom
claude-fixImageSizeVulnerability

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixes Dependabot alerts for image-size (GHSA-w3rx-r6r6-pgpr, GHSA-m5qc-5hw7-8vg7). No 1.x release fixes the ICNS bug, so we move off 1.x:

  • metro / metro-transform-plugins 0.84.4 → 0.84.5. Metro 0.84.5 drops image-size for vendored parsers. @expo/metro resolves to 56.0.2 (pins metro 0.84.5, within the existing ~56.0.0 range).
  • Override image-size → 2.0.4 for its last user, @callstack/repack. Re.Pack calls the named imageSize(buffer) export, which v2 keeps.
  • Renamed the metro and metro-runtime patches to 0.84.5. The patched files are byte-identical between 0.84.4 and 0.84.5.

AI tests: none run locally. npm install was unavailable, so I updated the lockfile by hand from registry metadata (integrity hashes and dependencies). CI npm ci validates it.

How it's used: build-time only, never shipped to clients. Metro (opt-in with BUNDLER=metro) and Re.Pack (the default native bundler) read local image assets to get their width and height for require('./img.png').

Change Log

image-size 1.1.1 / 1.2.1 → 2.0.4

  • 2.0.3/2.0.4: fix ICNS parser infinite loop (GHSA-w3rx-r6r6-pgpr)
  • 2.0.2 / 1.2.1: fix DoS via crafted payloads (GHSA-m5qc-5hw7-8vg7)
  • 2.0.0: dual CJS/ESM, Uint8Array input, zero dependencies, drops sync file-path API

metro 0.84.4 → 0.84.5 (release)

@expo/metro 56.0.0 → 56.0.2

  • Bumps pinned metro packages to 0.84.5

Fixed Issues

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

Tests

  1. npm ci. Verify patch-package applies metro+0.84.5.patch and metro-runtime+0.84.5.patch without errors.
  2. npm ls image-size metro. Verify only image-size@2.0.4 and metro@0.84.5 are installed.
  3. npm run ios and npm run android (Re.Pack). Verify local images (logos, illustrations, avatars) render with the correct size.
  4. BUNDLER=metro npm run ios. Verify the bundle loads and local images render.
  5. Edit a worklet file while the app runs. Verify Fast Refresh picks up the change.
  6. Build a release bundle (npm run android-build) and verify it succeeds.
  • Verify that no errors appear in the JS console

Offline tests

N/A, build tooling only.

QA Steps

  1. On iOS and Android, open the app and browse Inbox, Settings and Workspaces.
  2. Verify that bundled images and illustrations render at the correct size.
  • 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:38
@melvin-bot
melvin-bot Bot requested review from daledah and removed request for a team October 5, 2026 12:38
@melvin-bot

melvin-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

@daledah 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 check is unrelated to this PR, so I didn't push a change.

Analysis: Only test (job 1) fails. Nine tests in tests/unit/hooks/useGettingStartedItems.test.ts fail with ReferenceError: Request is not defined. The error comes from expo's fetch polyfill, called from src/libs/HttpUtils.ts. Every Jest run started since about 12:37 UTC today fails the same 9 tests. That includes PRs that change no dependencies, such as [POC] oxlint - with scripts.

Evidence: This PR only changes package.json, package-lock.json, and the metro patches. The lockfile changes only bump metro to 0.84.5 and image-size to 2.0.4. None of these touch Jest, expo, fetch, or the failing test.

Details
  • Failing run: Jest Unit Tests, test (job 1)
  • Same failure, same 9 tests, on these runs: claude-bumpPdfjsDist (Bump pdfjs-dist to 6.3.289 to address security advisory), claude-updateUndici, claude-bumpFastXmlParser, claude-upgradeXlsxSecurity, and feat/oxlint.
  • Jest runs started before 12:37 UTC passed, and they used the same main commit. The only commit on main today merged at 12:00 UTC. So the cause looks environmental or time-dependent, not tied to a code change.
  • Check independent approval also fails, but that check only needs a reviewer's approval.
  • I couldn't run Jest locally in this environment. The conclusion rests on the CI logs above.

Next step: Re-run the failed job once the shared failure on main is fixed. If it keeps failing, someone should look at why useGettingStartedItems.test.ts makes a real fetch call without a mock.

@daledah

daledah commented Oct 6, 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 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
    • 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
    • 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 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.
  • 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).
  • 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

install 2 install

@daledah

daledah commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot please merge main

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I didn't merge main into this branch. A merge pushes a new commit, and I can only push to a PR when the PR author, an assignee, or an existing co-author asks.

To have me merge main, the PR assignee (amyevans) should reply tagging me with the same request.


view run

@daledah daledah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@melvin-bot
melvin-bot Bot requested a review from amyevans October 6, 2026 07:46
@melvin-bot melvin-bot Bot changed the title Upgrade metro to 0.84.5 and image-size to 2.0.4 to fix Dependabot alerts [Payment due @daledah] Upgrade metro to 0.84.5 and image-size to 2.0.4 to fix Dependabot alerts Oct 6, 2026
@melvin-bot

melvin-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

🎯 @daledah, 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/688707.

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.

…lnerability

Co-authored-by: Amy Evans <amyevans@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I merged main into this branch, which fixes the failing test (job 1) check. The fix is in commit 8e58a33.

The failing test was not caused by this PR. tests/unit/hooks/useGettingStartedItems.test.ts sent a real GetRules request without mocking fetch, so it threw ReferenceError: Request is not defined. [No QA] Mock fetch in useGettingStartedItems tests so GetRules stays off the network already fixed this on main. This branch was 501 commits behind main.

The merge applied cleanly. The PR diff is unchanged: the metro 0.84.5 bump, the image-size 2.0.4 override, and the renamed patches. The checklist and Check independent approval failures need reviewer action, not code changes.

Local test note

I couldn't confirm the fix with a local test run. In my sandbox, every Jest suite that imports @react-navigation fails to load with "Must use import to load ES Module". That includes suites unrelated to this PR. The same suites passed in this PR's earlier CI run, so the problem is my environment. CI on the new commit will confirm the fix.


view run

@amyevans
amyevans requested a review from a team October 6, 2026 10:23
@melvin-bot
melvin-bot Bot requested review from Eskalifer1 and removed request for a team October 6, 2026 10:23
@melvin-bot

melvin-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

@Eskalifer1 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]

@Eskalifer1

Copy link
Copy Markdown
Contributor

Hi! Seems like i'm second C+ here and it's already approved. If so could you please unassign me here, thank you!

@amyevans
amyevans removed the request for review from Eskalifer1 October 6, 2026 10:26

@NikkiWines NikkiWines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@amyevans

amyevans commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Yep, sorry for the noise @Eskalifer1!

@NikkiWines
NikkiWines merged commit 4050011 into main Oct 6, 2026
52 of 54 checks passed
@NikkiWines
NikkiWines deleted the claude-fixImageSizeVulnerability branch October 6, 2026 10:27
@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

🚧 NikkiWines 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/NikkiWines in version: 9.5.4-0 🚀

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

@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):

@melvin-bot

melvin-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #103376

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