1# Vulnerability Runbook
2
3This document outlines how Wasmtime maintainers should respond to a security
4vulnerability found in Wasmtime. This is intended to be a Wasmtime-specific
5variant of the [runbook
6RFC](https://github.com/bytecodealliance/rfcs/blob/main/accepted/vulnerability-response-runbook.md)
7originally created. More details are available in the RFC in some specific steps.
8
9Vulnerabilities and advisories are all primarily coordinated online through
10GitHub Advisories on the Wasmtime repository. Anyone can make an advisory on
11Wasmtime, and once created anyone can be added to an advisory. Once an advisory
12is created these steps are followed:
13
141. An **Incident Manager** is selected. By default this is the Wasmtime
15   maintainer that opened the advisory. If a contributor opened the advisory
16   then it's by default the first responder on the advisory. The incident
17   manager can, at any time, explicitly hand off this role to another
18   maintainer.
19
202. **Fill out the advisory details**. This step involves filling out all the
21   fields on the GitHub Advisory page such as:
22
23   * Description - the description field's initial placeholder has the various
24     sections to fill out. At this point at least a brief description of the
25     impact should be filled out. This will get fleshed out more later too.
26   * Affected versions - determine which previously released versions of
27     Wasmtime are affected by this issue.
28   * Severity - use the CVSS calculator to determine the severity of this
29     vulnerability.
30
313. **Collaborate on a fix**. This should be done in a private fork created for
32   the security advisory. This is also when any collaborators who can help with
33   the development of the fix should also be invited. At this time only the
34   `main` branch needs to have a fix.
35
364. **Finalize vulnerability details and patched versions**. After a fix has been
37   developed and the vulnerability is better understood at this point the
38   description of the advisory should be fully filled out and be made ready to
39   go to the public. This is also when the incident manager should determine the
40   number of versions of Wasmtime to patch. The latest two versions are
41   required, and older versions are optional.
42
435. **Request a CVE**. Use the Big Green Button on the advisory to request a CVE
44   number from GitHub staff.
45
466. **Send advanced disclosure email**. The incident manager will decide on a
47   disclosure date, typically no more than a week away, and send mail to
48   [email protected] about the upcoming security release. An
49   example mail [looks like
50   this](https://groups.google.com/a/bytecodealliance.org/g/sec-announce/c/7SjEU_qSE4U/m/Y6baLYkhAgAJ)
51
527. **Add more stakeholders** (optional). Users interested in getting advanced
53   notice about this vulnerability may respond to the mailing list post. The
54   incident manager will add them to the security advisory.
55
568. **Prepare PRs for patch releases**. This will involve creating more pull
57   requests in the private fork attached to the advisory. Each version of
58   Wasmtime being patched should have a PR ready-to-go which cleanly applies.
59   Be sure to write release notes on the PR for each release branch.
60
619. **The full test suite should be run locally for `main`**. Locally try to run
62   as much of the CI matrix as you can. You probably won't be able to run all of
63   it, and that's ok, but try to get the ones that may have common failures.
64   This is required because CI doesn't run on private forks.
65
6610. **Open version bump PRs on the public repository**. Use the
67    [online trigger][ci-trigger] for this workflow to open PRs for all versions
68    that are going to be patched. DO NOT include patch notes or release notes
69    for this fix. Use this time to fix CI by landing PRs to the release branches
70    separate from the version bump PR. DO NOT merge the version bump PR.
71
7211. **Manually make PRs on release day**. DO NOT merge via the security
73    advisory. This has generally not worked well historically because there's
74    too many CI failures and branch protections. On the day of the release make
75    public PRs from all of the previously-created PRs on the private fork.
76    You'll need to push the changes to your own personal repository for this,
77    but that's ok since it's time to make things public anyway. Merge all PRs
78    (including to `main`) once CI passes.
79
8012. **Merge version bump PRs**. Once the fixes have all been merged and CI is
81    green merge all the version bump PRs. That will trigger the automatic
82    release process which will automatically publish to crates.io and publish
83    the release.
84
8513. **Publish the GitHub Advisories**. Delete the private forks and hit that Big
86    Green Button to publish the advisory.
87
8814. **Send mail about the security release**. Send another around of mail to
89    [email protected] describing the security release. This mail
90    looks [like
91    this](https://groups.google.com/a/bytecodealliance.org/g/sec-announce/c/7SjEU_qSE4U/m/zjW9fWlcAAAJ).
92
93You'll want to pay close attention to CI on release day. There's likely going to
94be CI failures with the fix for the vulnerability for some build configurations
95or platforms and such. It should be easy to fix though so mostly try to stay on
96top of it. Additionally be sure to carefully watch the publish process to
97crates.io. It's possible to hit rate limits in crate publication which
98necessitates a retry of the job later. You can also try publishing locally too
99from the release branch, but it's best to do it through CI.
100