Skip to content

Commit 94f2301

Browse files
Updates based on TWG discussions
1 parent 215e05e commit 94f2301

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

proposals/advisory-db.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The TOML frontmatter must contain a table called `advisory` and a table called `
9090
* `date`, a TOML local date, which is the disclosure date.
9191
* `url`, an optional string, which is a link to a resource such as release notes or a blog post that describes the issue in detail
9292
* `cwe`, an optional array of integers, each of which is a [CWE identifier](https://cwe.mitre.org/index.html)
93-
* `cvss`, an optional string, which is a [CVSS 3.1 vector](https://www.first.org/cvss/)
93+
* `cvss`, an mandatory string, which is a [CVSS 3.1 vector](https://www.first.org/cvss/)
9494
* `keywords`, an optional array of strings, which may be any string that the submitter finds relevant. By convention, they are written in lowercase.
9595
* `aliases`, an optional array of strings, each of which is another identifier such as a CVE
9696
* `related`, an optional array of strings, each of which is an identifier for a related advisory (such as for a wrapped C library)
@@ -138,6 +138,8 @@ We recommend that consumers who do not use the Cabal API to process build and fr
138138

139139
We additionally recommend that tools prioritize `.cabal` files, followed by freeze files, followed by consulting `stack.yaml` to retrieve the constraints of a Stackage resolver. This recommendation is because virtually all Haskell projects have `.cabal` files (some of which are generated by tools such as `hpack`), and because Stackage sets can be parsed using the same tools as Cabal freeze files.
140140

141+
Tools that automatically update bounds to exclude packages that have advisories should only do so on freeze files. Otherwise, we are likely to end up with many holes in the allowed dependency versions of intermediate transitive dependencies, which could lead to fragmentation, difficult-to-read build configurations, and complicated dependency errors. Projects without freeze files will ideally be presented only with a warning, and left to react appropriately themselves.
142+
141143
### Governance and Administration
142144

143145
The Haskell Foundation will be responsible for appointing the administrators of the database. Administrators are expected to be trusted community members who are willing to provide timely feedback in the repository. The Haskell Foundation should check from time to time that feedback is timely, and can serve as a final arbiter of disputes.
@@ -146,6 +148,8 @@ To begin with, the HF executive team will assemble a group of five volunteers, w
146148

147149
We expect that the work done by this team will occur mostly asynchronously, but we plan to have meetings a few times per year in order to have discussions about how the group is working and how it can be improved.
148150

151+
Because CVSS is a bit complex, PRs without CVSS will be provisionally accepted, and the volunteers will work with reporters to help them fill out the field appropriately.
152+
149153

150154
### Deliverables
151155

@@ -157,7 +161,7 @@ The deliverables are:
157161

158162
### Risks and Mitigations
159163

160-
There are primarily reputational risks associated with this project. Low-quality or false advisories risk damaging the reputation of package authors or maintainers, as well as that of the project and/or organization.
164+
There are primarily reputational risks associated with this project. Low-quality or false advisories risk damaging the reputation of package authors or maintainers, as well as that of the project and/or organization. To mitigate this, we plan to institute a reporting process that notifies authors in private first, and links to a standard responsible-disclosure process for non-responsive authors. In other words, a PR should not be the first step for non-package-authors.
161165

162166
There are very few technical risks to the project itself, as the technology involved is simple and well-understood.
163167

@@ -200,11 +204,7 @@ Goals left for future work are:
200204
1. Develop a reverse-import tool to import GitHub's own security advisories into the canonical database using their GraphQL API
201205
2. Augment build tools such as `cabal` and `stack` with the ability to audit dependencies and build plans for known advisories
202206
3. Augment Hackage and Stackage with information about advisories
203-
204-
205-
206-
207-
208-
207+
4. A standard format for advisories to be ignored in the context of a given project, whether it be specific IDs or based on CVSS
208+
5. Automatically-generated remote freeze files that exclude certain classes of packages with advisories, allowing users to simply point a build tool at the remote file to rule out many vulnerable package versions all at once.
209209

210210

proposals/advisory-db/app/Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ data Advisory = Advisory
131131
advisoryCWEs :: [CWE],
132132
advisoryKeywords :: [Keyword],
133133
advisoryAliases :: [Text],
134-
advisoryCVSS :: Maybe Text,
134+
advisoryCVSS :: Text,
135135
advisoryVersions :: VersionRange,
136136
advisoryArchitectures :: Maybe [Architecture],
137137
advisoryOS :: Maybe [OS],
@@ -154,7 +154,7 @@ renderAdvisory adv =
154154
row "CWEs" (T.intercalate ", " . map (T.pack . show . unCWE) . advisoryCWEs),
155155
row "Keywords" (T.intercalate ", " . map (T.pack . show) . advisoryKeywords),
156156
row "Aliases" (T.intercalate ", " . advisoryAliases),
157-
row "CVSS" (fromMaybe "" . advisoryCVSS),
157+
row "CVSS" advisoryCVSS,
158158
row "Versions" (T.pack . show . advisoryVersions),
159159
row
160160
"Architectures"
@@ -200,7 +200,7 @@ parseAdvisory table = runTableParser $ do
200200
aliases <-
201201
fromMaybe []
202202
<$> optional advisory "aliases" (isArrayOf isString)
203-
cvss <- optional advisory "cvss" isString
203+
cvss <- mandatory advisory "cvss" isString -- TODO validate CVSS format
204204

205205
(os, arch, decls) <-
206206
optional table "affected" isTable >>= \case

proposals/advisory-db/example.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ url = "https://github.com/username/package/issues/123"
1818
# Optional: Classification of the advisory with respect to the Common Weakness Enumeration.
1919
cwe = [820]
2020

21-
# Optional: a Common Vulnerability Scoring System score. More information
21+
# Mandatory: a Common Vulnerability Scoring System score. More information
2222
# can be found on the CVSS website, https://www.first.org/cvss/.
23-
#cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
23+
# The committee will assist advisory authors in constructing an appropriate CVSS if necessary.
24+
cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
2425

2526
# Freeform keywords which describe this vulnerability (optional)
2627
keywords = ["ssl", "mitm"]

0 commit comments

Comments
 (0)