Skip to content

Commit 146bd2b

Browse files
authored
Merge pull request #15 from ietf-wg-httpapi/early-reviews
Early reviews
2 parents 3cde05e + f22801c commit 146bd2b

File tree

4 files changed

+77
-22
lines changed

4 files changed

+77
-22
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,42 @@ repository constitutes Contributions to the IETF Standards Process
1515
You agree to comply with all applicable IETF policies and procedures, including,
1616
BCP 78, 79, the TLP, and the TLP rules regarding code components (e.g. being
1717
subject to a Simplified BSD License) in Contributions.
18+
19+
20+
## Working Group Information
21+
22+
Discussion of this work occurs on the [Building Blocks for HTTP APIs
23+
Working Group mailing list](mailto:[email protected])
24+
([archive](https://mailarchive.ietf.org/arch/browse/httpapi/),
25+
[subscribe](https://www.ietf.org/mailman/listinfo/httpapi)).
26+
In addition to contributions in GitHub, you are encouraged to participate in
27+
discussions there.
28+
29+
**Note**: Some working groups adopt a policy whereby substantive discussion of
30+
technical issues needs to occur on the mailing list.
31+
32+
You might also like to familiarize yourself with other
33+
[Working Group documents](https://datatracker.ietf.org/wg/httpapi/documents/).
34+
35+
## How to Contribute
36+
37+
Contributions can be made by creating pull requests, opening an issue, or
38+
posting to the working group mailing list. See above for the email address
39+
and a note about policy.
40+
41+
Here are two ways to create a pull request ("PR"):
42+
43+
- Copy the repository and make a pull request using the Git command-line
44+
tool, using the [GitHub documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) if needed.
45+
46+
- You can use the GitHub UI as follows:
47+
- View the draft source
48+
- Select the pencil icon to edit the file (usually top-right on the screen)
49+
- Make edits
50+
- Select "Commit changes"
51+
- Add a title and explanatory text
52+
- Select "Propose"
53+
- When prompted, click on "Create Pull Request"
54+
55+
Document authors/editors are often happy to accept contributions of text,
56+
and might be willing to help you through the process. Email them and ask.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# License
22

33
See the
4-
[guidelines for contributions](https://github.com/richsalz/draft-rsalz-httpapi-privacy/blob/main/CONTRIBUTING.md).
4+
[guidelines for contributions](https://github.com/ietf-wg-httpapi/httpapi-privacy/blob/main/CONTRIBUTING.md).

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
This is the working area for the IETF [HTTPAPI Working Group](https://datatracker.ietf.org/group/httpapi/documents/) Internet-Draft, "API Keys and Privacy".
66

7-
* [Editor's Copy](https://richsalz.github.io/draft-rsalz-httpapi-privacy/#go.draft-ietf-httpapi-privacy.html)
7+
* [Editor's Copy](https://ietf-wg-httpapi.github.io/httpapi-privacy/#go.draft-ietf-httpapi-privacy.html)
88
* [Datatracker Page](https://datatracker.ietf.org/doc/draft-ietf-httpapi-privacy)
99
* [Working Group Draft](https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-privacy)
10-
* [Compare Editor's Copy to Working Group Draft](https://richsalz.github.io/draft-rsalz-httpapi-privacy/#go.draft-ietf-httpapi-privacy.diff)
10+
* [Compare Editor's Copy to Working Group Draft](https://ietf-wg-httpapi.github.io/httpapi-privacy/#go.draft-ietf-httpapi-privacy.diff)
1111

1212

1313
## Contributing
1414

1515
See the
16-
[guidelines for contributions](https://github.com/richsalz/draft-rsalz-httpapi-privacy/blob/main/CONTRIBUTING.md).
17-
18-
Contributions can be made by creating pull requests.
19-
The GitHub interface supports creating pull requests using the Edit (✏) button.
16+
[guidelines for contributions](https://github.com/ietf-wg-httpapi/httpapi-privacy/blob/main/CONTRIBUTING.md).
2017

18+
The contributing file also has tips on how to make contributions, if you
19+
don't already know how to do that.
2120

2221
## Command Line Usage
2322

draft-ietf-httpapi-privacy.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ informative:
4848
--- abstract
4949

5050
Redirecting HTTP requests to HTTPS, a common pattern for human-facing web
51-
resources, can be an anti-pattern for authenticated API traffic. This document
51+
resources, can be an anti-pattern for authenticated HTTP API traffic.
52+
This document
5253
discusses the pitfalls and makes deployment recommendations for authenticated
5354
HTTP APIs. It does not specify a protocol.
5455

@@ -71,7 +72,8 @@ intermediary implementations have a prominently displayed option to enable it
7172
automatically.
7273

7374
When client authentication is used, more care must be taken. The client's
74-
initial request may include a Bearer token or other credential; once the request
75+
initial request may include a Bearer token or other credential (such as
76+
a Cookie); once the request
7577
has been sent on the network, any passive attacker who can see the traffic can
7678
acquire this credential and use it.
7779

@@ -85,6 +87,13 @@ This document describes actions API servers and clients should take in order to
8587
safeguard credentials. These recommendations are not directed at resources where
8688
no authentication is used.
8789

90+
Some have wondered if this document is really necessary. After all, we have
91+
been telling people not to send passwords and such in the clear for decades.
92+
Regrettably, this lesson seems to be largely forgotten by those developing
93+
Web-based APIs. The blog post that motivated this document, {{BLOG}}, did a
94+
spot-check in May, 2024, and found over two dozen websites that were
95+
vulnerable to the issues listed here.
96+
8897

8998
## Conventions and Definitions
9099

@@ -110,7 +119,8 @@ new server, while HSTS requires a successful prior connection to the server and
110119
relies on the client to implement persistent storage of the HSTS directive.
111120

112121
Used together, however, both approaches make clients less likely to send any
113-
requests over an insecure channel. Servers with authenticated endpoints SHOULD
122+
requests over an insecure channel.
123+
HTTP API servers with authenticated endpoints SHOULD
114124
employ both mechanisms.
115125

116126
## Connection Blocking
@@ -120,15 +130,17 @@ the developer or user is less likely to notice the misconfiguration. Where
120130
possible, it is advantageous for such a misconfiguration to fail immediately so
121131
that the error can be noticed and corrected.
122132

123-
Servers MAY induce such an early failure by not accepting unencrypted
133+
HTTP API servers MAY induce such an early failure by not accepting unencrypted
124134
connections, e.g. on port 80. This makes it impossible for a client to send a
125135
credential over an insecure channel to the authentic server, as no such channel
126-
can be opened. Servers MAY alternatively restrict connections on port 80 to
136+
can be opened.
137+
HTTP API servers MAY alternatively restrict connections on port 80 to
127138
network sources which are more trusted, such as a VPN or virtual network
128139
interface.
129140

130141
However, this mitigation is limited against active network attackers, who can
131-
impersonate the server and accept the client's insecure connection attempt.
142+
impersonate the HTTP API server and accept the client's insecure
143+
connection attempt.
132144

133145
## Credential Restriction
134146

@@ -142,28 +154,32 @@ to indicate the expected usage to the client.
142154

143155
Some deployments may not find it feasible to completely block unencrypted
144156
connections, whether because the hostname is shared with unauthenticated
145-
endpoints or for infrastructure reasons. Therefore, servers need a response for
157+
endpoints or for infrastructure reasons. Therefore, HTTP API servers need
158+
a response for
146159
when a credential has been received over an insecure channel.
147160

148161
HTTP status code 403 (Forbidden) indicates that "the server understood the
149-
request but refuses to fulfill it" {!HTTP=RFC9110}. While this is generally
150-
understood to mean that "the server considers [the credentials] insufficient to
162+
request but refuses to fulfill it" {{!HTTP=RFC9110}}. While this is generally
163+
understood to mean that "the server considers \[the credentials] insufficient to
151164
grant access," it also states that "a request might be forbidden for reasons
152-
unrelated to the credentials." Servers SHOULD return status code 403 to all
165+
unrelated to the credentials." HTTP API servers SHOULD return status
166+
code 403 to all
153167
requests received over an insecure channel, regardless of the validity of the
154168
presented credentials.
155169

156170
Because a difference in behavior would enable attackers to guess and check
157-
possible credentials, a server MUST NOT return a different client response
171+
possible credentials, an HTTP API server MUST NOT return a different client
172+
response
158173
between a valid or invalid credential presented over an insecure connection.
159174
Differences in behavior MUST only be visible on subsequent use of the credential
160175
over a secure channel.
161176

162177
### Credential Revocation
163178

164179
When a request is received over an unencrypted channel, the presented credential
165-
is potentially compromised. Servers SHOULD revoke such credentials immediately.
166-
When the credential is next used over a secure channel, a server MAY return an
180+
is potentially compromised. HTTP API servers SHOULD revoke such
181+
credentials immediately.
182+
When the credential is next used over a secure channel, the server MAY return an
167183
error that indicates why the credential was revoked.
168184

169185
Credentials in a request can take on different forms. API keys and tokens are simple
@@ -182,7 +198,8 @@ recommendations above.
182198
## Implement Relevant Protocols
183199

184200
Clients SHOULD support and query for HTTPS records {{!RFC9460}} when
185-
establishing a connection. This gives servers an opportunity to provide more
201+
establishing a connection. This gives HTTP API servers an opportunity
202+
to provide more
186203
complete information about capabilities, some of which are security-relevant.
187204

188205
Clients SHOULD respect HSTS headers {{!RFC6797}} received
@@ -212,7 +229,7 @@ This entire document is about security of HTTP API interactions.
212229
The behavior recommended in {{credential-revocation}} creates the potential for
213230
a denial of service attack where an attacker guesses many possible credentials
214231
over an unencrypted connection in hopes of discovering and revoking a valid one.
215-
Servers implementing this mitigation MUST also guard against such attacks, such
232+
HTTP API servers implementing this mitigation MUST also guard against such attacks, such
216233
as by limiting the number of requests before closing the connection and
217234
rate-limiting the establishment of insecure connections.
218235

0 commit comments

Comments
 (0)