You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/advisory-db.md
+38-3Lines changed: 38 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,18 +103,53 @@ The `affected` table, if present, contains the following fields, all of which ar
103
103
*`declarations`, a table that maps fully-qualified names from the package to Cabal v2.0 version ranges. These ranges must all be contained in the affected versions (specified later), and they specify that the given name is the source of the advisory in that sub-range. This allows one advisory to mention a function or datatype that is renamed at some point during development.
104
104
The `versions` table contains a single mandatory key, `affected`, whose value is a string that contains a Cabal v2.0 version range.
105
105
106
-
Cabal v2.0 version ranges are specified using the following grammar: TODO
106
+
Cabal v2.0 version ranges are specified using the following grammar:
107
+
108
+
```
109
+
VersionNum ::= "0" | [1-9][0-9]{0-8} -- Up to nine digits, no leading 0
110
+
111
+
Version ::= VersionNum | VersionNum "." Version -- Any number of VersionNum, dot-separated
112
+
113
+
VersionRange ::=
114
+
"==" Version |
115
+
">" Version |
116
+
"<" Version |
117
+
"<=" Version |
118
+
">=" Version |
119
+
"^>=" Version |
120
+
VersionRange "&&" VersionRange |
121
+
VersionRange "||" VersionRange |
122
+
"(" VersionRange ")"
123
+
```
124
+
125
+
In the above, `&&` binds more tightly than `||`, so `VersionRange1 && VersionRange2 || VersionRange3` is equivalent to `(VersionRange1 && VersionRange2) || VersionRange3`.
126
+
127
+
Ordering (and thus equality) of version numbers is defined in the Haskell [Package Versioning Policy](https://pvp.haskell.org). Ordering is defined lexicographically with respect to the numeric values of version number components. This means, for instance, that `1.5.3.0 > 1.5.3`.
128
+
129
+
The `^>=` operator defines both lower and upper bounds for a dependency according to the following desugaring:
130
+
*`^>= x ↝ >= x && < x.1`
131
+
*`^>= x.y ↝ >= x.y && < x.(y+1)`
132
+
*`^>= x.y.z ↝ >= x.y.z && < x.(y+1)`
133
+
*`^>= x.y.z.u ↝ >= x.y.z.u && < x.(y+1)`
134
+
* and so forth
135
+
107
136
108
-
Tools that detect vulnerabilities will need to check whether advisory version ranges overlap with dependency version constraints. The algorithm for this is TODO.
109
137
110
138
### Recommendations Regarding Build/Freeze Files
111
139
112
-
TODO: Which formats do we recommend they look in to start with? `.cabal`, `cabal.freeze`? Stack users' constraints mostly come from their snapshot - how can we make this work for people with no constraints in `.cabal` and a `stack.yaml` file?
140
+
TODO: How do we actually let them look at cabal files? Common stanzas and conditionals make this fairly non-trivial.
141
+
142
+
TODO - Recommendation will be to do the following:
143
+
* First process Cabal files
144
+
* Then do freeze files, which should allow processing Stackage resolver files as well
145
+
* Then read stack.yaml enough to get the resolver
113
146
114
147
### Governance and Administration
115
148
116
149
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.
117
150
151
+
To begin with, the HF executive team will assemble a group of five volunteers, who will be solicited from bodies such as the Core Libraries Committee and the Hackage trustees, asking for a one-year commitment. The HF will evaluate the size and composition of the group on an ongoing basis, and may make adjustments to membership. We will recruit a set of volunteers with knowledge of cryptography, low-level exploits such as buffer overflows, the GHC RTS, network security, and security organization best practices, as well as good communication skills, and will adjust the size of the volunteer group until these areas are covered.
This is a proof-of-concept parser and renderer for the advisory format. It accepts an advisory on stdin, and either fails or emits an HTML rendering on stdout.
0 commit comments