Bump resolve-url-loader to v5 to drop forbidden postcss@7.0.39 (8.16.2) - #427
Open
jsbalrog wants to merge 5 commits into
Open
Bump resolve-url-loader to v5 to drop forbidden postcss@7.0.39 (8.16.2)#427jsbalrog wants to merge 5 commits into
jsbalrog wants to merge 5 commits into
Conversation
….16.2) Artifactory's security policy now returns 403 Forbidden for postcss-7.0.39.tgz, which breaks `npm install` on the build/publish step of every app consuming @fs/react-scripts. postcss@7.0.39 reached consumers only transitively via resolve-url-loader@4: @fs/react-scripts -> resolve-url-loader@4 -> postcss@7.0.39 7.0.39 is the last 7.x release and the relevant ReDoS advisory was only patched in postcss 8.4.31+, so there is no allowed 7.x fallback. resolve-url-loader v5 uses postcss 8, removing postcss 7 entirely. The webpack config passes only `sourceMap` and `root` to the loader, both still supported in v5 (v5 dropped only the deprecated engine/keepQuery/absolute/attempts options). v5 also drops Node < 12 support, a non-issue for current apps. Verified: postcss@7.0.39 gone from the lockfile, resolve-url-loader@5.0.0 resolved. The equivalent change was validated end-to-end in a consumer (ux-playground built successfully in production mode with resolve-url-loader@5 via an npm override), exercising the same Sass/CSS pipeline this loader drives. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Travis npmrc needs to be updated to not scope to |
There was a problem hiding this comment.
Pull request overview
This PR updates @fs/react-scripts to remove the forbidden transitive dependency on postcss@7.0.39 (blocked by Artifactory), by bumping resolve-url-loader to v5 (which uses PostCSS 8) and releasing @fs/react-scripts@8.16.2.
Changes:
- Bump
resolve-url-loaderfrom^4.0.0to^5.0.0and update the root lockfile accordingly (removingpostcss@7.0.39from the dependency tree). - Bump
@fs/react-scriptsversion8.16.1→8.16.2. - Add a
CHANGELOG-FRONTIER.mdentry and adjust Travis registry configuration.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react-scripts/package.json | Version bump and dependency bump to resolve-url-loader@^5. |
| package-lock.json | Regenerated lockfile reflecting resolve-url-loader@5 and PostCSS 8. |
| CHANGELOG-FRONTIER.md | Documents the dependency/security-related release rationale for 8.16.2. |
| .travis.yml | Updates npm registry configuration used during CI install/publish steps. |
Suppressed comments (1)
.travis.yml:26
- Same registry/auth endpoint mismatch here: the lockfile
resolvedURLs andpublishConfig.registryuse.../artifactory/api/npm/..., but this .npmrc writes credentials for.../familysearch/api/npm/.... Using the/artifactory/api/npm/endpoint consistently avoids auth-token scoping issues during the additional installs infreshCraTemplateUpdate.sh.
- echo "//familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/:_authToken=${NPM_PUBLISH_TOKEN}" >> ${HOME}/tmp/fresh-cra-template/.npmrc
- echo "registry=https://familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/" >> ${HOME}/tmp/fresh-cra-template/.npmrc
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+6
to
+10
| - echo "//familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/:_authToken=${NPM_PUBLISH_TOKEN}" >> ~/.npmrc | ||
| - echo "@fs:registry=https://familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/" >> ~/.npmrc | ||
| - echo "registry=https://familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/" >> ~/.npmrc | ||
| # because this is a weird monorepo and we cd into and out of directories, this is what worked for travis to publish | ||
| - echo "//familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/:_authToken=${NPM_PUBLISH_TOKEN}" >> packages/react-scripts/.npmrc | ||
| - echo "@fs:registry=https://familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/" >> packages/react-scripts/.npmrc | ||
| - echo "registry=https://familysearch.jfrog.io/familysearch/api/npm/fs-npm-prod-virtual/" >> packages/react-scripts/.npmrc |
Artifactory's curation service returns 403 for any package version with a CVSS >= 9 CVE that has a fix available. Eight transitive versions in the tree were blocked, failing `npm install` in CI: axios@0.25.0 (docusaurus/website <- wait-on) undici@6.19.8 (docusaurus/website <- cheerio) handlebars@4.7.8 (root devDeps <- lerna) lodash.template@4.5.0 (root devDeps <- lerna) form-data@2.3.3 (root devDeps <- request <- node-gyp) tough-cookie@2.5.0 (root devDeps <- request <- node-gyp) parse-url@6.0.5 (root devDeps <- git-up <- lerna) plist@2.1.0 (root devDeps <- svg-term-cli) None are in the published @fs/react-scripts runtime tree, so no consumer was affected and no version bump is required. Fixes, in order of preference: - Drop the `docusaurus/website` workspace. Nothing builds it (no script or CI step references it) and it is pinned to @docusaurus/core 2.0.0-alpha.64 inherited from upstream. Removing it eliminates axios@0.25.0 and undici@6.19.8 outright, with no override needed. - Refresh handlebars 4.7.8 -> 4.7.9 and lodash.template 4.5.0 -> 4.18.1; both already satisfied their parents' ranges. - Add root `overrides` for the four whose parent ranges cap them below the patched version (request's ~2.3.2/~2.5.0, git-up's ^6.0.0, svg-term-cli/term-schemes' ^2.1.0). All are dev-only tooling, and the root package is private so these cannot reach consumers. Verified with a cold-cache `npm ci` against a scratch copy of the tree: 2919 packages installed, zero curation blocks. A warm npm cache masks these failures locally, since curation is enforced on tarball fetch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
create-react-app exits 0 even when installing the template's dependencies fails: init.js logs "`npm install ...` failed" and returns. That is deliberate upstream behavior, not a bug -- exiting non-zero makes create-react-app's error handler delete the generated app's package.json and node_modules, which would destroy a scaffold that only needs `npm install` re-run. So this asserts on the result instead of changing init.js, and keeps the fork from diverging further on an upstream file. Without it the real failure surfaced two steps later as `sh: 1: react-scripts: not found` (exit 127), which reads like a react-scripts packaging problem. The actual cause in the build that prompted this was postcss@7.0.39 being blocked by jfrog curation, reached via the template's Storybook 6 devDependencies and via the upstream react-scripts that @storybook/preset-create-react-app pulls in as a peer -- neither of which involves @fs/react-scripts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
Artifactory's security policy now returns 403 Forbidden for
postcss-7.0.39.tgz. That breaksnpm installon the build/publish step of every app consuming@fs/react-scripts— the failure surfaces in consumers, not here, which makes it easy to misdiagnose as an app-level problem.postcss@7.0.39reaches consumers only transitively:7.0.39is the last release on the postcss 7 line, and the relevant ReDoS advisory was only ever patched in postcss 8.4.31+ — there is no allowed 7.x to fall back to.npm updatecan't help either: the parent semver ranges (^7.0.35,^4.0.0) cap it inside its current majors.Fix
Bump
resolve-url-loader^4.0.0→^5.0.0inpackages/react-scripts/package.json. v5 depends on postcss 8, sopostcss@7.0.39leaves the tree entirely. Fixing it here retires the issue for every consumer at once, instead of each app carrying a localoverridesworkaround.Included in this PR (self-contained release):
resolve-url-loaderbump8.16.1→8.16.2CHANGELOG-FRONTIER.mdentrypackage-lock.jsonCompatibility
packages/react-scripts/config/webpack.config.js) passes onlysourceMapandrootto the loader — both still supported in v5. v5 dropped only the deprecatedengine/keepQuery/absolute/attemptsoptions, none of which are used here.Verification
postcss@7.0.39in lockfileresolve-url-loaderresolved5.0.0@fs/react-scripts8.16.2The full react-scripts suite runs in CI (Azure Pipelines) on this PR. As an additional real-world signal, the equivalent change was validated end-to-end in a consumer: ux-playground built successfully in production mode with
resolve-url-loader@5(applied via an npmoverridesentry as an interim fix — fs-webdev/ux-playground#190), which exercises the same Sass/CSSurl()-rewriting pipeline this loader drives.After this ships
Consumers can bump to
@fs/react-scripts@8.16.2and remove their interimresolve-url-loaderoverride (e.g. ux-playground's).🤖 Generated with Claude Code