[Aikido] Fix 4 security issues in lodash, webpack - #80
Closed
aikido-autofix[bot] wants to merge 1 commit into
Closed
aikido-autofix[bot] wants to merge 1 commit into
aikido-autofix[bot] wants to merge 1 commit into
Conversation
Package lock diff |
Author
|
Closed by Aikido: a new AutoFix has been created → #97 |
aikido-autofix
Bot
deleted the
fix/aikido-security-update-packages-63010999-6gse
branch
August 25, 2026 00:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade lodash and webpack to fix critical RCE vulnerability in template compilation via options.imports injection, plus medium-severity prototype pollution in unset/omit functions and webpack magic comments.
✅ Code not affected by breaking changes.
✅ No breaking changes from either the lodash (4.17.21 => 4.18.1) or webpack (5.98.0 => 5.107.2) upgrades affect this codebase.
Lodash findings:
No usage of
_.unset()or_.omit()found in the codebaseNo usage of
_.template()found in the codebaseWhile lodash is present as a dependency (version 4.18.1 in package-lock.json), the actual source code does not directly import or use any of the affected lodash methods
Webpack findings:
No usage of
HttpUriPluginorallowedUrisconfigurationNo usage of
import.metapropertiesNo usage of
import deferorimport.sourcesyntaxNo CSS modules with
css/moduleorcss/autotypesNo ES modules exporting a binding named
"module.exports"that would be affected by the CommonJS require changesWhile the codebase has
export defaultstatements for React components (e.g., inexamples/with-serverless/src/pages/page-2.js), these are all named constants (likeSecondPage,Layout,ClientOnlyRoutes) rather than anonymous functions or classes, so the.nameproperty change does not affect themThe one anonymous default export found (
gatsby-plugin-s3-e2e-tests/src/cleanupLambda.ts) is unlikely to be impacted as it's a test utility and the.nameproperty is not relied uponAll breaking changes are either not used in this codebase or do not apply to the patterns present in the code.
All breaking changes by upgrading lodash from version 4.17.21 to 4.18.1 (CHANGELOG)
_.unset/_.omitnow blockconstructorandprototypeas non-terminal path keys unconditionally. Calls that previously returnedtrueand deleted the property now returnfalseand leave the target untouched._.templatenow throws"Invalid imports option passed into _.template"whenimportskeys contain forbidden identifier characters, which were previously allowed.All breaking changes by upgrading webpack from version 5.98.0 to 5.107.2 (CHANGELOG)
import.meta.env.xxxbehavior: when accessing a non-existent property, it now returns empty object instead of full object at runtime..nameto"default"for anonymous default export functions and classes per ES specmodule.generator.javascript.anonymousDefaultExportNameoption to control whether webpack sets.nameto"default"for anonymous default export functions and classes per ES spec. Defaults totruefor applications andfalsefor libraries (whenoutput.libraryis set) to avoid unnecessary bundle size overhead.pureparser option forcss/moduleandcss/autotypes matchingpostcss-modules-local-by-default's pure mode: every selector must contain at least one local class or id, otherwise webpack emits a build error.import defer * as nsmore spec-compliant:ns.x = valueno longer triggers module evaluation (per the TC39 import-defer[[Set]]algorithm), and the deferred namespace is now a distinct object from the eager namespace, with the same Deferred Module Namespace Exotic Object shared across defer-import call sites for the same module.new import.defer(...)andnew import.source(...)as a parse-timeSyntaxError, matching the spec —ImportCallis aCallExpressionand is not a valid operand ofnew.require()of an ES module with Node.js'srequire(esm)"module.exports"named-export convention. When CommonJSrequire()resolves to an ES module that exports a binding with the literal string name"module.exports",require()now returns the value of that export instead of the module's namespace object.✅ 4 CVEs resolved by this upgrade, including 1 critical 🚨 CVE
This PR will resolve the following CVEs:
🤖 Remediation details
Fix transitive security vulnerabilities in lodash, lodash.template, and webpack
This PR remediates security vulnerabilities in three transitive dependencies —
lodash,lodash.template, andwebpack— none of which appear as direct dependencies inexamples/with-serverless/package.json. The fixes are applied viaoverridesentries added toexamples/with-serverless/package.json(forlodashandwebpack) and a lockfile-only refresh (forlodash.template), with all resolved versions updated inexamples/with-serverless/package-lock.json.lodash
lodashwas resolved at4.17.21as a transitive dependency pulled in by multiple parents includinggatsby,gatsby-cli,gatsby-plugin-offline, and others. The immediate parentgatsby@5.15.0declares"lodash": "^4.17.21", a range that semver-allows4.18.1, butnpm updateonly advanced the lockfile to4.17.23(safe-chain suppressed newer versions during resolution). Because no parent bump could force the lockfile past that ceiling, a selector-pattern override"lodash@<4.18.1": "4.18.1"was added toexamples/with-serverless/package.jsonto pin all vulnerable instances to the patched floor without globally forcing a version on unrelated consumers.lodash.template
lodash.templateis a standalone modular npm package (distinct from the monolithiclodash) and was resolved at4.5.0as a transitive dependency ofworkbox-build@4.3.1.workbox-builddeclares"lodash.template": "^4.4.0", a range that already permits4.18.0+, so no override or parent bump was required — runningnpm update lodash.template --package-lock-onlywas sufficient to refresh the lockfile entry to4.18.1.webpack
webpackwas resolved at5.98.0, pulled in primarily bygatsby@5.15.0, which pins it with the tilde range"~5.98.0"(allowing only5.98.x). No published version ofgatsbyresolveswebpackto≥5.107.2, making a parent bump impossible. A selector-pattern override"webpack@<5.107.2": "5.107.2"was added toexamples/with-serverless/package.jsonto advance the resolved version to the patched release without affecting consumers that legitimately depend on other webpack major versions.Version changes
lodash4.17.214.18.1"lodash@<4.18.1": "4.18.1");npm updatestalled at4.17.23due to safe-chain suppressionlodash.template4.5.04.18.1workbox-build@4.3.1range^4.4.0already permits patched versionwebpack5.98.05.107.2"webpack@<5.107.2": "5.107.2"); parentgatsby@5.15.0tilde-pins~5.98.0, blocking any parent-bump path