Skip to content

Commit b142f0a

Browse files
committed
Add EXAMPLE_ADVISORY.md
Adds an example advisory in the V3 format (#414) and updates the schema information in README.md to reflect that.
1 parent 7338ca9 commit b142f0a

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

EXAMPLE_ADVISORY.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "crate-name"
5+
date = "2020-01-31"
6+
url = "https://example.com"
7+
categories = ["code-execution", "privilege-escalation"]
8+
keywords = ["example", "freeform", "keywords"]
9+
#aliases = ["CVE-YYYY-NNNN"]
10+
#cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
11+
12+
[versions]
13+
patched = [">= 1.2.3"]
14+
unaffected = ["0.1.2"]
15+
16+
[affected]
17+
#arch = ["x86"]
18+
#os = ["windows"]
19+
functions = { "crate_name::MyStruct::vulnerable_fn" = ["< 1.2.3"] }
20+
```
21+
22+
# RustSec Advisory Template - Advisory Title Goes Here
23+
24+
This is an example template for a RustSec advisory. Please copy this to
25+
`crates/<crate-name>` and rename it to `RUSTSEC-0000-0000.md`.
26+
27+
In this section of the advisory you can write an extended description
28+
of the vulnerability, will be converted into HTML and rendered at
29+
<https://rustsec.org>.
30+
31+
- Markdown formatted
32+
- TOML "front matter". See `README.md` for schema.
33+
- Please include as much detail as you'd like.
34+
35+
A well structured advisory will include information like:
36+
37+
Affected versions of this crate did not properly X.
38+
39+
This allows an attacker to Y.
40+
41+
The flaw was corrected by Z.

README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ See [CONTRIBUTING.md] for more information.
2424

2525
## Advisory Format
2626

27-
Each advisory contains information in [TOML] format:
27+
See [EXAMPLE_ADVISORY.md] for a template.
28+
29+
Advisories are formatted in [Markdown] with [TOML] "front matter".
30+
Below is the scehma of the "front matter" section of an advisory:
2831

2932
```toml
3033
# Before you submit a PR using this template, **please delete the comments**
@@ -41,9 +44,6 @@ package = "mycrate"
4144
# Disclosure date of the advisory as an RFC 3339 date (mandatory)
4245
date = "2019-10-01"
4346

44-
# Single-line description of a vulnerability (mandatory)
45-
title = "Flaw in X allows Y"
46-
4747
# URL to a long-form description of this issue, e.g. a GitHub issue/PR,
4848
# a change log entry, or a blogpost announcing the release (optional)
4949
url = "https://github.com/mystuff/mycrate/issues/123"
@@ -68,15 +68,6 @@ keywords = ["ssl", "mitm"]
6868
# e.g. CVE for a C library wrapped by a -sys crate)
6969
#references = ["CVE-2018-YYYY", "CVE-2018-ZZZZ"]
7070

71-
# Enter a short-form description of the vulnerability here (mandatory)
72-
description = """
73-
Affected versions of this crate did not properly X.
74-
75-
This allows an attacker to Y.
76-
77-
The flaw was corrected by Z.
78-
"""
79-
8071
# Optional: metadata which narrows the scope of what this advisory affects
8172
[affected]
8273
# CPU architectures impacted by this vulnerability (optional).
@@ -124,6 +115,8 @@ All content in this repository is placed in the public domain.
124115

125116
[//]: # (general links)
126117

118+
[EXAMPLE_ADVISORY.md]: https://github.com/RustSec/advisory-db/blob/master/EXAMPLE_ADVISORY.md
119+
[Markdown]: https://www.markdownguide.org/
127120
[TOML]: https://github.com/toml-lang/toml
128121
[cargo-audit]: https://github.com/rustsec/cargo-audit
129122
[cargo-deny]: https://github.com/EmbarkStudios/cargo-deny

0 commit comments

Comments
 (0)