@@ -48,7 +48,8 @@ informative:
4848--- abstract
4949
5050Redirecting 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
5253discusses the pitfalls and makes deployment recommendations for authenticated
5354HTTP APIs. It does not specify a protocol.
5455
@@ -71,7 +72,8 @@ intermediary implementations have a prominently displayed option to enable it
7172automatically.
7273
7374When 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
7577has been sent on the network, any passive attacker who can see the traffic can
7678acquire this credential and use it.
7779
@@ -117,7 +119,8 @@ new server, while HSTS requires a successful prior connection to the server and
117119relies on the client to implement persistent storage of the HSTS directive.
118120
119121Used together, however, both approaches make clients less likely to send any
120- requests over an insecure channel. Servers with authenticated endpoints SHOULD
122+ requests over an insecure channel.
123+ HTTP API servers with authenticated endpoints SHOULD
121124employ both mechanisms.
122125
123126# # Connection Blocking
@@ -127,15 +130,17 @@ the developer or user is less likely to notice the misconfiguration. Where
127130possible, it is advantageous for such a misconfiguration to fail immediately so
128131that the error can be noticed and corrected.
129132
130- 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
131134connections, e.g. on port 80. This makes it impossible for a client to send a
132135credential over an insecure channel to the authentic server, as no such channel
133- 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
134138network sources which are more trusted, such as a VPN or virtual network
135139interface.
136140
137141However, this mitigation is limited against active network attackers, who can
138- 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.
139144
140145# # Credential Restriction
141146
@@ -149,28 +154,32 @@ to indicate the expected usage to the client.
149154
150155Some deployments may not find it feasible to completely block unencrypted
151156connections, whether because the hostname is shared with unauthenticated
152- 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
153159when a credential has been received over an insecure channel.
154160
155161HTTP status code 403 (Forbidden) indicates that "the server understood the
156- request but refuses to fulfill it" {!HTTP=RFC9110}. While this is generally
162+ request but refuses to fulfill it" {{ !HTTP=RFC9110} }. While this is generally
157163understood to mean that "the server considers \[the credentials] insufficient to
158164grant access," it also states that "a request might be forbidden for reasons
159- 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
160167requests received over an insecure channel, regardless of the validity of the
161168presented credentials.
162169
163170Because a difference in behavior would enable attackers to guess and check
164- 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
165173between a valid or invalid credential presented over an insecure connection.
166174Differences in behavior MUST only be visible on subsequent use of the credential
167175over a secure channel.
168176
169177# ## Credential Revocation
170178
171179When a request is received over an unencrypted channel, the presented credential
172- is potentially compromised. Servers SHOULD revoke such credentials immediately.
173- 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
174183error that indicates why the credential was revoked.
175184
176185Credentials in a request can take on different forms. API keys and tokens are simple
@@ -189,7 +198,8 @@ recommendations above.
189198# # Implement Relevant Protocols
190199
191200Clients SHOULD support and query for HTTPS records {{!RFC9460}} when
192- establishing a connection. This gives servers an opportunity to provide more
201+ establishing a connection. This gives HTTP API servers an opportunit
202+ to provide more
193203complete information about capabilities, some of which are security-relevant.
194204
195205Clients SHOULD respect HSTS headers {{!RFC6797}} received
@@ -219,7 +229,7 @@ This entire document is about security of HTTP API interactions.
219229The behavior recommended in {{credential-revocation}} creates the potential for
220230a denial of service attack where an attacker guesses many possible credentials
221231over an unencrypted connection in hopes of discovering and revoking a valid one.
222- Servers implementing this mitigation MUST also guard against such attacks, such
232+ HTTP API ervers implementing this mitigation MUST also guard against such attacks, such
223233as by limiting the number of requests before closing the connection and
224234rate-limiting the establishment of insecure connections.
225235
0 commit comments