Skip to content

[No QA] [Snyk] Security upgrade svgo from 4.0.0 to 4.0.2#96749

Open
MelvinBot wants to merge 4 commits into
mainfrom
snyk-fix-1ff371a780f178b4b7cefec2f164a225
Open

[No QA] [Snyk] Security upgrade svgo from 4.0.0 to 4.0.2#96749
MelvinBot wants to merge 4 commits into
mainfrom
snyk-fix-1ff371a780f178b4b7cefec2f164a225

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #96750
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • 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.
  • 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

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SVGO-18170231
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Merge Risk: Low

This is a patch upgrade from svgo version 4.0.0 to 4.0.2. This range includes minor bug fixes and type declaration improvements.

  • v4.0.1: Fixes type declarations.
  • v4.0.2: Fixes an issue in the convertColors plugin.

No breaking changes are documented in this version range.

Source: GitHub Releases

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

@MelvinBot
MelvinBot requested a review from a team as a code owner July 22, 2026 14:23
@melvin-bot
melvin-bot Bot requested review from chuckdries and removed request for a team July 22, 2026 14:24
@melvin-bot

melvin-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa19388168

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread package.json
"storybook": "10.4.6",
"storybook-react-rsbuild": "^3.3.4",
"svgo": "^4.0.0",
"svgo": "^4.0.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the lockfile with the svgo bump

This change only updates package.json, but package-lock.json still declares the root svgo dependency as ^4.0.0 and locks node_modules/svgo to 4.0.0 (package-lock.json:280, package-lock.json:39340). In any workflow where the node_modules cache is missed, .github/actions/composite/setupNode/action.yml runs npm ci, and npm's ci docs state that mismatched package/lock dependencies exit with an error instead of updating the lock (https://docs.npmjs.com/cli/v8/commands/npm-ci); even when installs are not rerun, the committed lockfile still leaves the vulnerable 4.0.0 package selected. Please regenerate and commit package-lock.json for svgo@4.0.2 with this bump.

Useful? React with 👍 / 👎.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Fixed the failing checks.

Root cause: This Snyk commit bumped svgo from 4.0.0^4.0.2 in package.json but left package-lock.json pinned at 4.0.0. Every job that runs npm ci (tests, Storybook, builds, knip, spellcheck, etc.) failed with:

npm error `npm ci` can only install packages when your package.json and package-lock.json ... are in sync.
npm error Invalid: lock file's svgo@4.0.0 does not satisfy svgo@4.0.2

Fix: Synced package-lock.json with the svgo@4.0.2 bump (commit 48541bb):

  • Root devDependencies reference ^4.0.0^4.0.2
  • node_modules/svgo version/resolved/integrity updated to 4.0.2
  • svgo's only changed dependency, sax, ^1.4.1^1.5.0 — already satisfied by the existing sax@1.6.0 in the lockfile, so no other tree changes were required

This is exactly the change npm install would produce for this bump. The checks should pass on the next run.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing Verify Javascript Action Builds check.

Root cause: This PR bumps svgo from 4.0.0 to 4.0.2, but the compiled action bundle .github/actions/javascript/checkSVGCompression/index.js — which inlines svgo — wasn't rebuilt to match. The verify job re-runs npm run gh-actions-build and fails when the freshly-built bundle differs from what's committed (the committed file still had the old svgo 4.0.0 output).

Fix: Ran npm run gh-actions-build with svgo 4.0.2 installed and committed the regenerated bundle. Only checkSVGCompression/index.js changed; the diff is the expected svgo 4.0.0 → 4.0.2 output (e.g. VERSION bump and the updated removeScripts/removeViewBox plugin code).

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No failing checks remain. The previously-failing Verify Javascript Action Builds (verify) check now passes on the latest run after I rebuilt the checkSVGCompression action bundle for the svgo 4.0.2 bump (commit 3f57c0b). The remaining checks (test jobs, perf tests, typecheck, ESLint, HybridApp builds) are still running normally — none have failed.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The verify (Verify Javascript Action Builds) check is now passing after my previous push. The only remaining failure is ESLint check, and it's unrelated to this svgo bump — it's a pre-existing failure caused by the branch being out of date with main.

What's failing:

scripts/utils/TSCompilerUtils.ts
  261:1  error  Unused eslint-disable directive (no problems were reported from 'rulesdir/no-negated-variables')

Why: main already deleted that stale // eslint-disable-next-line rulesdir/no-negated-variables directive in scripts/utils/TSCompilerUtils.ts (commit e2f5cc4, PR Expensify/App#96758). This branch predates that change, so it still carries the directive, which now lints as unused. The file is not part of this PR's diff.

Recommended fix: Bring the branch up to date with main (git merge main), which removes the directive and clears the error. I didn't do this automatically because updating this branch pulls in a large amount of unrelated main history (including a Node/TypeScript upgrade) and creates conflicts in package.json / package-lock.json between the svgo bump and main's changes — that's better resolved by a human who can confirm the intended dependency state. Alternatively, deleting that single stale directive line would also make lint pass.

@chuckdries chuckdries self-assigned this Jul 22, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing check is unrelated to this PR — it's an infrastructure flake, not a code or test failure.

What failed: Only test (job 1) (Jest shard 1/8) failed. Its failure annotation was:

The self-hosted runner lost communication with the server. Verify the machine is running and has a healthy network connection. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.

The Blacksmith runner dropped mid-run — the test job never reported a test result. Shards 2–8 of the same suite all passed, and every other check (ESLint, typecheck, Storybook, perf, Snyk, etc.) is green.

Why it's not related to your changes: This PR only bumps svgo 4.0.0 → 4.0.2, regenerates the checkSVGCompression action bundle + package-lock.json, and drops one stale eslint-disable comment. None of that changes Jest's memory footprint or the tests in shard 1, so there's no code fix to push here.

Recommended action: Re-run the failed job — gh run rerun 29954704582 --repo Expensify/App --failed (or the "Re-run failed jobs" button on the run page). I attempted the re-run myself but don't have permission to trigger workflow runs in this environment.

@mkhutornyi

Copy link
Copy Markdown
Contributor

If this requires C+ review, I can help.
Here's linked issue: #96750

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@chuckdries
chuckdries requested a review from a team July 22, 2026 21:24
@chuckdries chuckdries changed the title [Snyk] Security upgrade svgo from 4.0.0 to 4.0.2 [No QA] [Snyk] Security upgrade svgo from 4.0.0 to 4.0.2 Jul 22, 2026
@melvin-bot
melvin-bot Bot requested review from youssef-lr and removed request for a team July 22, 2026 21:25
@melvin-bot

melvin-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

@youssef-lr 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]

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.

4 participants