Manually execute `ng new` deps postinstall scripts
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- typescript
Piste de recherche
Commencez par examiner le flux ng new qui exécute automatiquement npm install et déterminez comment les scripts postinstall sont actuellement gérés. La tâche est terminée lorsque l’exécution automatique générale de postinstall est désactivée, que seuls les packages connus requis sont invoqués et qu’une couverture est ajoutée pour détecter les dépendances postinstall manquantes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
🚀 Feature request
Command (mark with an x)
- new
Description
Currently, ng new will automatically run npm install which (if the user has not disabled it), automatically runs all postinstall scripts. This can be a vulnerability since any compromised package in the NPM dependency graph could add a postinstall step to install malware on developer machines.
Describe the solution you'd like
We could reduce the attack surface by disabling postinstall on the automatic npm install and then manually invoke the postinstall for a known set of required packages. Only 3 packages currently use postinstall steps, so limiting execution to just those would significantly reduce the attack surface for a potential supply chain attack.
One possible concern is for dependencies which add a required postinstall step in the future. We can pretty easily add a test to make sure we aren't missing any postinstall steps from our transitive dependencies, though this inherently breaks abstraction somewhat. Adding a postinstall step is (somewhat debate-ably) a breaking change, so any package which adds one in the future should require a major version bump where we have an opportunity to allowlist it.
The one edge case I can think of is if we have:
ng-new-app@0.0.0 -> package-a@^1.0.0 -> package-b@^1.0.0
And package-b gets a new postinstall step in v2.0.0. However, package-a may be able to manage the breakage without violating their own public API (or maybe doesn't notice the new postinstall step) and simply bumps to v1.0.1. This would immediately be pulled in to the next ng new command and fail. I think such a scenario would actually be a bad patch release for package-a, since adding a required postinstall step is fundamentally a breaking change. We would rely on NPM package maintainers to make the right semver-compatible decisions for a somewhat nuanced case, but this is probably better than the alternative.
- Langage dominant
- TypeScript
- Étoiles
- 27k
- Forks
- 11.8k
- Merge moyen
- 17 h 25 min
- PR mergées (30 j)
- 183
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Ouvertearea: @angular/build gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/angular-cli#33055 · 1 commentaire · 3 réactions ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 personne assignée ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 personne assignée ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 1 personne assignée ·
Toutes les issues de angular/angular-cli
Issues similaires
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Ouverteclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
supermomonga/zcode-acp#24 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100