<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V5.0//EN" "http://docbook.org/xml/5.0/dtd/docbook.dtd">
<article xmlns="http://docbook.org/ns/docbook" version="5.0" class="journalarticle" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en-US">
	<info>
		<abstract>
			When security vulnerabilities are discovered by researchers, proper reporting channels are often lacking. As a result, vulnerabilities may be left unreported.  Fortunately, there is a machine-parsable format to help organizations describe their vulnerability disclosure practices to make it easier for researchers to report vulnerabilities.
		</abstract>
		<author>
			<personname>
				<firstname>Colin</firstname>
				<surname>Cogle</surname>
			</personname>
		</author>
		<copyright>
			"A File Format to Aid in Security Vulnerability Disclosure" by Colin Cogle is licensed under the <link xlink:href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA)</link> license.
		</copyright>
		<date>2022-05-19</date>
		<issuenum>2</issuenum>
		<pagenums>57-58</pagenums>
		<pubdate>2021-06-19</pubdate>
		<publisher>
			<publishername>2600: The Hacker Quarterly</publishername>
		</publisher>
		<revhistory>
			<revision>
				<revnumber>1.1</revnumber>
				<date>2022-05-19</date>
				<revremark>Updated to reflect that the standard was finalized.</revremark>
			</revision>
			<revision>
				<revnumber>1.0</revnumber>
				<date>2021-06-19</date>
				<revremark>As published in 2600.</revremark>
			</revision>
		</revhistory>
		<title>A File Format to Aid in Security Vulnerability Disclosure</title>
		<volumenum>38</volumenum>
	</info>

	<dedication label="Please support 2600!">
		This article was first published in Volume 38:2 (the Summer 2021 issue) of <citetitle pubwork="journal">2600: The Hacker Quarterly</citetitle>.  Please support the official release by buying a <link xlink:href="https://store.2600.com/collections/2020-2021/products/summer-2021">paper copy</link> or <link xlink:href="https://store.2600.com/collections/pdf-downloads/products/new-issue-pdf-summer-2021" xlink:title="It's DRM-free!">PDF copy</link> of the magazine.
	</dedication>

	<sect1>
		<para>
			In an age where scoring bug bounties is some peoples' primary source of income, and responsible disclosure is the norm rather than the exception, it can be quite difficult to figure out where	and how to report a security vulnerability. I ran into that problem with a vendor of mine.  I came across a problem involving unescaped input, and searched high and low for a way to securely report it. In the end, I opened a ticket with their help desk, where they had me just tell them the problem in a clear-text email.
		</para>

		<para>
			I'm not alone, either.  In fact, in <link xlink:href="https://store.2600.com/collections/2020-2021/products/new-issue-pdf-spring-2021">the Spring 2021 issue of <citetitle pubwork="journal">2600: The Hacker Quarterly</citetitle></link>, fellow reader <citation>Kiefer Chiang</citation> wrote about finding a bug in a municipal web portal, and the weeks-long ordeal of trying to get his report securely into the eyeballs of the right person.
		</para>

		<para>
			How many vulnerabilities have gone unreported, sold on the dark web, or <link xlink:href="https://www.forbes.com/sites/marcochiappetta/2018/08/29/depressed-security-researcher-drops-serious-0-day-windows-exploit-on-twitter/?sh=71359cc372b1">simply blurted out on Twitter</link>, only because getting in touch with the appropriate person was impossible?
		</para>

		<para>
			When a security issue needs to be reported, time is of the essence. There needs to be a quick, standard way to find the <emphasis>right</emphasis> contact information, their encryption keys, and the preferred way to file your report. Fortunately, <link xlink:href="https://datatracker.ietf.org/doc/rfc9116">there is a standard</link>, meekly called the <filename>security.txt</filename> file.
		</para>

		<para>
			<filename>security.txt</filename> is a plain, UTF-8 encoded text file that is designed to be both human- and machine-readable.  For ease of discovery, it lives in the well-known <filename class="directory">.well-known</filename> folder on the root of your Web server.
		</para>
	</sect1>

	<sect1>
		<para>
			In this article, let's assume we're looking at a <filename>security.txt</filename> file for the popular fictional company, Contoso:
		</para>

		<informalexample pgwide="1">
			<screen linenumbering="numbered">-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

# This is the <filename>security.txt</filename> file for Contoso.com.
Canonical: https://contoso.com/.well-known/security.txt
Canonical: https://www.contoso.com/.well-known/security.txt
Canonical: https://webapp.contoso.com/.well-known/security.txt

# For security issues, please contact our security team.
# Email is preferred, but you may also call us or chat with us.
Contact: mailto:security@contoso.com
Contact: tel:+1-800-555-5555,123
Contact: MSTeams:/l/chat/0/0?users=alice@contoso.com,bob@contoso.com
Contact: https://contoso.com/contact-us#security-disclosures

# Our PGP key is available in a variety of places.
Encryption: https://contoso.com/pgp/securityteam.asc
Encryption: dns:5d2d3ceb7abe552344276d47d36a8175b7aeb250a9bf0bf00e850cd2._openpgpkey.contoso.com?type=OPENPGPKEY
Encryption: openpgp4fpr:1234567890ABCDEF1234567890ABCD

# We speak English, Spanish, and French.
Preferred-Languages: en, es, fr

# We welcome you to explore our site for bugs, but before you do, please
# read our disclosure agreement.
Policy: https://contoso.com/security-policy.html

# Thank you for your reports!  Why not join our security team?
Acknowledgments: https://contoso.com/humans.txt
Hiring: https://contoso.com/jobs#security

Expires: 2021-12-31T23:59:59Z

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE8QHuP28wHqb4E6Yt4H79M4zP+valid+signature+here=
-----END PGP SIGNATURE-----</screen>
		</informalexample>

		<para>
			That's a lot to take in at once, so let's break it down. Aside from the comments, there are many fields	you can use in a <filename>security.txt</filename> file. All fields can appear in any order, most fields are optional, and many of them can be repeated as many times as necessary. Most field values accept a <acronym>URI</acronym>, which can be of any scheme <emphasis>except</emphasis> non-secure <acronym>HTTP</acronym>.
		</para>

		<sect2 id="canonical">
			<para>
				The first field is called <firstterm>Canonical</firstterm>. This should specify the <acronym>URL</acronym>s used to reach this <filename>security.txt</filename> file, to ensure that security researchers have found the correct file.
			</para>
		</sect2>

		<sect2 id="contact">
			<para>
				Up next is <firstterm>Contact</firstterm>, and this one is mandatory. This is where you specify your points of contact, in <acronym>URI</acronym> format, in order of preference.  In this example, I've included an email address, a phone number, a link to start a Microsoft Teams chat with our old friends Alice and Bob, as well as a webpage with contact information.  That should be enough for anyone.
			</para>
		</sect2>

		<sect2 id="encryption">
			<para>
				Next, we have the <firstterm>Encryption</firstterm> field, where you provide <acronym>URI</acronym>s to download or find an encryption key, usually an OpenPGP key or <acronym>S/MIME</acronym> certificate.  In this example, the contacts' <acronym>PGP</acronym> key can be downloaded from the web server or directly from a <acronym>DNSSEC</acronym>-signed <acronym>DNS</acronym> zone.  The fingerprint is also provided, not only for reference, but in case the researcher wants to download it on their own.
			</para>
		</sect2>

		<sect2 id="preflang">
			<para>
				<firstterm>Preferred-Languages</firstterm> is fairly obvious.  List all human languages that your contacts understand. This field can only appear once, so list them all in one line.
			</para>
		</sect2>

		<sect2 id="policy">
			<para>
				You may want people to follow some ground rules when searching for or reporting bugs.  If you have a security policy, use the <firstterm>Policy</firstterm> field to link people to it.
			</para>
		</sect2>

		<sect2 id="acknowledgments">
			<para>
				Of course, no standard would be complete without a few fun things.  <firstterm>Acknowledgments</firstterm> links to a resource where this company will thank security researchers who have helped them out, and if you need to bolster your company's own red or blue teams, <firstterm>Hiring</firstterm> is a link to your security-related job postings.
			</para>
		</sect2>

		<sect2 id="expires">
			<para>
				Finally, there is the required <firstterm>Expires</firstterm> field, to make sure that anyone who might be reading this file knows that they have fresh data.  The <filename>security.txt</filename> standard recommends that this timestamp be no more than one year in the future.
			</para>
		</sect2>

		<sect2>
			<para>
				Now that you have your <filename>security.txt</filename> file, it's recommended that you <acronym>PGP</acronym>-clearsign it, to prove to your reader that all of the data is authentic and correct. Once that's done, upload it to your <acronym>HTTPS</acronym>-enabled web server.  Now, you can sleep easier, knowing that if there <emphasis>is</emphasis> a problem, a security researcher will know how to reach you.
			</para>

			<para>
				Oh, and that vendor I mentioned at the top of the article?  They now have their own <filename>security.txt</filename> file.
			</para>

			<para>
				The <filename>security.txt</filename> standard exists as <acronym>RFC</acronym> 9116, developed by Edwin "EdOverflow" Foudil, Yakov Shafranovich, and the open-source community.  To learn more, please visit their web site at <link xlink:href="https://securitytxt.org"><uri type="website">https://securitytxt.org</uri></link>.
			</para>
		</sect2>
	</sect1>

	<bibliolist>
		<biblioentry>
			<abbrev>Keifer Chiang</abbrev>
			<author>
				<personname>
					<firstname>Keifer</firstname>
					<surname>Chiang</surname>
				</personname>
			</author>
			<publisher>
				<publishername>2600: The Hacker Quarterly</publishername>
			</publisher>
			<citetitle>What Hacking My County's Election Worker Portal Taught Me</citetitle>
		</biblioentry>
	</bibliolist>
</article>