Vérification des backports de sécurité Chrome

VérifiéPrudence

Backportez les correctifs de sécurité Chrome manquants sur une branche Electron, validez localement et poussez une PR unique.

Spar Skills Guide Bot
SecuriteAvancé
29/08/2026
Claude Code
#cve#backport#electron#chrome#patch-management

Recommandé pour

Synthèse automatique

Détermine quels correctifs CVE de Chrome manquent réellement dans le code source synchronisé d'une branche Electron, écrit les patches cherry-pick localement, les valide via `e sync --3` et `lint --patches`, puis pousse une PR unique.

Points forts

  • Approche « local-first » : rien n'est poussé avant que chaque patch ne s'applique et ne passe le lint.
  • Vérifie la présence réelle des correctifs dans l'arbre synchronisé (git log par bug, Change-Id, patches existants) au lieu de se fier au changelog.
  • Privilégie les CL de merge du milestone cible, déjà rebasés, ce qui réduit fortement les conflits.
  • Écarte automatiquement les fichiers non compilés par Electron (chrome/browser, chrome/android, ios, android).

Limites

  • Suppose une toolchain Electron complète (`e`, depot_tools, accès Gerrit, worktree synchronisé) — inutilisable ailleurs.
  • Dépend du blog Chrome Releases et de l'API Gerrit : toute évolution de ces sources casse le flux.
  • La résolution des conflits de patch reste manuelle et la fin du processus (lint, push de la PR) est peu détaillée dans le document.
Quand l'utiliser

Pour porter une release de sécurité Chrome stable dans une branche Electron N-x-y avec un ensemble de cherry-picks vérifié.

Quand l'éviter

Pour un projet non-Electron, ou pour simplement savoir si une CVE affecte une version Electron publiée sans disposer d'un checkout source synchronisé.

Analyse de sécurité

Prudence
Score qualité90/100

The skill performs powerful but legitimate engineering operations: fetching patches, modifying a local Electron checkout, validating with build tooling, and opening a PR. There is no evidence of destructive commands, secret exfiltration, obfuscated payload execution, or safety-disabling behavior, but the network-to-file writes and git push/PR steps warrant caution.

Points d'attention
  • •Uses extensive shell, git, network, and GitHub CLI operations for legitimate release backporting.
  • •Instructs downloading patches with curl from Gerrit/googlesource and piping through base64 -d into repository files; trusted source, but still writes remote content locally.
  • •Modifies repository patch/config files and pushes a branch and PR, which can affect shared state if run incorrectly.
  • •No allowed-tools declaration despite relying on bash, network, git, gh, and Electron build tooling.
Comment cette analyse est faite

Exemples

Backport a stable release
Backport the Chrome security release at https://chromereleases.googleblog.com/2026/04/stable-channel-update-for-desktop_15.html to 41-x-y and open a single PR with the validated cherry-picks.
Check if a CVE is already fixed
Is CVE-2026-1234 already in 41-x-y? Check the synced source and existing patches before writing anything.
Validate the patch set
Produce the cherry-pick set for 41-x-y from this blog URL and validate it with e sync --3 and lint --patches before pushing.

name: chrome-release-verify description: End-to-end Chrome security backport for an Electron release branch. Given a Chrome Releases blog URL and a branch (e.g. 41-x-y), determines which CVE fixes are missing from the actual synced source, writes the cherry-pick patches locally, validates them with e sync --3 + lint --patches, then pushes a single PR. Use when asked to backport a Chrome security release to N-x-y, "is CVE-X already in N-x-y?", or to produce/validate the cherry-pick set for a release branch.

Chrome Release → Validated Backport PR

Input: $ARGUMENTS = <release-branch> <chrome-releases-blog-url> (e.g. 41-x-y https://chromereleases.googleblog.com/2026/04/stable-channel-update-for-desktop_15.html). Ask if either is missing.

The flow is local-first: nothing is pushed until every patch applies via e sync --3 and passes lint --patches.

1. Map CVE → bug → fix CL

Run /chrome-release-cls <blog-url> (or its inline procedure) to produce /tmp/cve_bugs.txt (CVE|bug|severity|desc) and a per-bug canonical fix CL. For each CL also note repo (path under src/: ., v8, third_party/{skia,angle,pdfium,dawn}, third_party/libaom/source/libaom) and gerrit-host.

Prefer the target-milestone merge CL if one exists (e.g. on 41-x-y ≈ M146, prefer the [M146] cherry-pick over the main CL) — it's already rebased and far less likely to conflict. Find it via git log --all --grep on the Change-Id, or Gerrit ?q=bug:<n>. If Chrome did not merge a fix to the target milestone, that's a strong signal the vulnerable code doesn't exist there — flag it for skip rather than forcing a port.

2. Prepare a synced worktree

Reuse bp-<NN> from e show configs if present, else e worktree add bp-<NN> ~/src/electron-bp-<NN> --source <current> --no-sync.

cd <root>/src/electron
git fetch origin <branch>
git checkout -B security-backport/<branch>/<short-date> origin/<branch>
e use bp-<NN>
e sync 2>&1 | tee /tmp/bp_sync.log

If sync fails with NotADirectoryError: '<root>/src/.git/objects/info/alternates', remove GIT_CACHE_PATH from the bp config's env and retry.

3. Verify IN-TREE vs NEEDS-BACKPORT

For each bug, three checks against the synced repo:

  1. git -C "$repo" log HEAD --since='1 year ago' -E --grep="\b${bug}\b" --format='%h %s'
  2. Fetch Change-Id from Gerrit, then git log HEAD --grep="^Change-Id: ${cid}$"
  3. grep -rlE "(\b${bug}\b|${cid})" <root>/src/electron/patches/

Any hit ⇒ IN-TREE. All empty ⇒ NEEDS-BACKPORT.

For each NEEDS-BACKPORT CL, also fetch its file list (/changes/<proj>~<cl>/revisions/current/files) and skip if every file is under chrome/browser/, chrome/android/, ios/, or components/**/android/ — Electron doesn't compile those.

Report the table now (CVE | Sev | Bug | Component | Verdict | CL) and the proposed backport set; get user sign-off before continuing.

4. Write patches locally (no push yet)

For each backport CL, fetch the raw patch and write it into patches/<dir>/:

curl -s "https://${host}.googlesource.com/changes/${proj//\//%2F}~${cl}/revisions/current/patch" \
  | base64 -d > "patches/${dir}/cherry-pick-${short}.patch"
echo "cherry-pick-${short}.patch" >> "patches/${dir}/.patches"

For repos with no Gerrit host e cherry-pick supports (e.g. libaom on aomedia), instead git cherry-pick the upstream commits onto the synced sub-repo HEAD and git format-patch the result.

For any newly-created patches/<dir>/, append to patches/config.json preserving the compact one-line-per-entry style:

  { "patch_dir": "src/electron/patches/<dir>", "repo": "src/third_party/<dir-or-nested-path>" }

5. Validate with e sync --3

e sync --3 2>&1 | tee /tmp/bp_sync3.log

On Patch failed at NNNN <subject>:

  • cd into the failing repo, inspect git diff for conflict markers.
  • Test-only files (e.g. web_tests/VirtualTestSuites, *_unittest.cc context drift): take ours (git checkout --ours -- <file>) if the security-relevant hunks merged cleanly.
  • Substantive code conflicts: check whether a target-milestone merge CL exists and swap to it. If none exists upstream and the surrounding code is structurally different, drop the patch (delete the file, remove from .patches and config.json) and note it for a separate manual-port PR — do not improvise security-fix semantics.
  • After resolving: git add <files> && git -c commit.gpgsign=false am --continue, then e patches <repo> to export the resolved patch, then re-run e sync --3. Repeat until clean.

6. Export → lint → re-apply loop

e patches all
node script/lint.js --patches   # must exit 0

If lint reports findings (typically trailing whitespace on + content lines), fixing them changes the bytes the patch writes, which invalidates the index <old>..<new> blob hashes that e patches baked in. Hand-editing a .patch and pushing it as-is will pass lint locally but fail CI's Apply Patches re-export check with a one-line index hash diff.

So whenever lint (or you) modifies any .patch file after export, round-trip once more:

# fix the lint findings in patches/**/*.patch, then:
e sync            # re-apply the edited patches (no --3 needed; they applied cleanly last time)
e patches all     # re-export so index blob hashes match the edited content
node script/lint.js --patches      # must now exit 0
git diff --quiet -- patches/ || { echo "patches changed again — repeat the loop"; }

Repeat until lint --patches exits 0 and git diff -- patches/ is empty after the final e patches all. Only then is the patch set CI-stable.

7. Commit, push, PR

git add patches/
git commit -m "chore: cherry-pick <N> changes from <dirs>"
git push origin HEAD
gh pr create --repo electron/electron --base <branch> --head <this-branch> \
  --title "chore: cherry-pick <N> changes from <dirs>" \
  --label "<branch>" --label backport-check-skip --label semver/patch --label "security 🔒" \
  --body-file /tmp/pr_body.md

PR body format — follow .github/PULL_REQUEST_TEMPLATE.md (Description of Change / Checklist / Release Notes sections; PRs that don't follow it are auto-closed):

#### Description of Change

Backports the following changes:

* [`<shortCommit>`](<gerrit-CL-url>) from <patchDir> — <subject>
* ...

#### Checklist

- [x] I have filled out the PR description
- [x] [I have reviewed and verified the changes](https://github.com/electron/governance/blob/main/policy/ai.md)

#### Release Notes

Notes: Backported fixes from upstream Chromium and V8.

Keep the PR body low-key about security. The PR is public the moment it opens, while the fixes only protect users after a release ships — don't advertise the exploit map in between. Concretely: no CVE numbers, no crbug.com links, no "security"/"0-day"/severity wording anywhere in the title, body, or Notes: line. The security 🔒 label is fine (it's how releases track these). Upstream commit subjects stay verbatim even when they say "UAF" — rewriting them breaks traceability to the Gerrit CL. Adjust the Notes: wording to match what's actually in the set (e.g. drop "and V8" if no v8 patches).

Keep the CVE↔CL mapping out of the PR entirely: leave it in the local notes file (/tmp/cve_cls.txt) and report it to the user in chat, including any dropped or skipped fixes with reasons.

Restore e use <previous> when done.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/chrome-security-backport-verification-mte1lfkh' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/chrome-security-backport-verification-mte1lfkh/download' --output '.skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md.part' && mv '.skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md.part' '.skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md' && test -s '.skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/chrome-release-verify' && cp -R '.skill-downloads/chrome-security-backport-verification-mte1lfkh' '.claude/skills/chrome-release-verify'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/chrome-security-backport-verification-mte1lfkh'

openskills read 'chrome-security-backport-verification-mte1lfkh'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/chrome-security-backport-verification-mte1lfkh/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires