IP Library Granted Patent US 10,608,821
Granted Patent B2
US 10,608,821 · App. 16/103,820 · Granted Mar 31, 2020

Providing cross site request forgery protection at an edge server

Inventor: Evan Johnson (San Francisco, CA)
Assignee: CLOUDFLARE, INC.
H04L9/3236G06F21/64H04L9/0643H04L9/0872H04L9/3213H04L9/3234H04L61/2007H04L63/08H04L63/108H04L63/1466H04L63/1483H04L67/02H04L67/18H04L61/1511H04L61/609
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,608,821
App. No.
16/103,820
Granted
Mar 31, 2020
Kind
B2
Abstract

A request from a computing device for accessing a resource is received by an edge server, where the request includes a cookie containing a first token value and a second token value. The edge server validates the first token value and a second token value using a third token value generated using hashing algorithm with a secret key and one or more other values. The edge server then compares the received token values with the third token value. When the request is validated, the edge server retrieves the request resource.

Claims (62)

1. A method, comprising:

generating, by an edge server, a first token value that includes a hash value generated by hashing a secret key and a first set of one or more other values using a hash algorithm;

including the first token value in a first cookie;

sending the first cookie to a client device, wherein the first cookie does not include the secret key;

receiving, from the client device, a first request for an action to be performed on a first resource that is hosted at an origin server, the first request including a second cookie that includes a second token value, and the first request including a third token value;

determining, using the first request, a second set of one or more other values;

generating a fourth token value by hashing the secret key and the second set of one or more other values using the hash algorithm;

determining that the second token value, the third token value, and the generated fourth token value are equivalent;

responsive to the determining that the second token value, the third token value, and the generated fourth token value are equivalent, sending the first request to the origin server;

receiving, from the client device, a second request for an action to be performed on a second resource that is hosted at the origin server, the second request including a third cookie that includes a fifth token value, and the second request including a sixth token value;

determining, using the request, a third set of one or more other values;

generating a seventh token value by hashing the secret key and the third set of one or more other values using the hash algorithm;

determining that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value; and

responsive to the determining that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value, preventing the second request from being transmitted to the origin server.

2. The method of claim 1 , further comprising:

modifying code of the first resource to include a client-side script that, when executed by the client device, causes the client device to transmit the third token value as part of the first request.

3. The method of claim 1 , wherein the third token value is included in one of a body of the first request and an HTTP request header of the first request.

4. The method of claim 1 , wherein the second set of one or more other values include an expiration time and one or more metadata.

5. The method of claim 4 , wherein the one or more metadata includes one or more of an IP address, a browser identifier, a host origin name, geo-location data, a device identifier, a user agent string, and other authentication data.

6. The method of claim 1 , wherein the first request for the action to be performed is a state-changing request for the first resource.

7. A non-transitory machine-readable storage medium that provides instructions that, when executed by a processor, cause said processor to perform operations comprising:

generating, by an edge server, a first token value that includes a hash value generated by hashing a secret key and a first set of one or more other values using a hash algorithm;

including the first token value in a first cookie;

sending the first cookie to a client device, wherein the first cookie does not include the secret key;

receiving, from the client device, a first request for an action to be performed on a first resource that is hosted at an origin server, the first request including a second cookie that includes a second token value, and the first request including a third token value;

determining, using the first request, a second set of one or more other values;

generating a fourth token value by hashing the secret key and the second set of one or more other values using the hash algorithm;

determining that the second token value, the third token value, and the generated fourth token value are equivalent;

responsive to the determining that the second token value, the third token value, and the generated fourth token value are equivalent, sending the first request to the origin server;

receiving, from the client device, a second request for an action to be performed on a second resource that is hosted at the origin server, the second request including a third cookie that includes a fifth token value, and the second request including a sixth token value;

determining, using the request, a third set of one or more other values;

generating a seventh token value by hashing the secret key and the third set of one or more other values using the hash algorithm;

determining that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value; and

responsive to the determining that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value, preventing the second request from being transmitted to the origin server.

8. The non-transitory machine-readable storage medium of claim 7 that provides instructions that, when executed by the processor, cause the processor to further perform operations comprising:

modifying code of the first resource to include a client-side script that, when executed by the client device, causes the client device to transmit the third token value as part of the first request.

9. The non-transitory machine-readable storage medium of claim 7 , wherein the third token value is included in one of a body of the first request and an HTTP request header of the first request.

10. The non-transitory machine-readable storage medium of claim 7 , wherein the second set of one or more other values include an expiration time and one or more metadata.

11. The non-transitory machine-readable storage medium of claim 10 , wherein the one or more metadata includes one or more of an IP address, a browser identifier, a host origin name, geo-location data, a device identifier, a user agent string, and other authentication data.

12. The non-transitory machine-readable storage medium of claim 7 , wherein the request for the action to be performed is a state-changing request for the resource.

13. An apparatus, comprising:

a processor;

a non-transitory machine-readable storage medium coupled with the processor that stores instructions that, when executed by the processor, cause said processor to perform the following:

generate, by an edge server, a first token value that includes a hash value generated by hashing a secret key and a first set of one or more other values using a hash algorithm;

include the first token value in a first cookie;

send the first cookie to a client device, wherein the first cookie does not include the secret key;

receive, from the client device, a first request for an action to be performed on a first resource that is hosted at an origin server, the first request to include a second cookie that includes a second token value, and the first request to include a third token value;

determine, using the first request, a second set of one or more other values

generate a fourth token value by hashing the secret key and the second set of one or more other values using the hash algorithm;

determine that the second token value, the third token value, and the generated fourth token value are equivalent;

responsive to the determination that the second token value, the third token value, and the generated fourth token value are equivalent, send the first request to the origin server;

receive, from the client device, a second request for an action to be performed on a second resource that is hosted at the origin server, the second request to include a third cookie that includes a fifth token value, and the second request to include a sixth token value;

determine, using the request, a third set of one or more other values;

generate a seventh token value by hashing the secret key and the third set of one or more other values using the hash algorithm;

determine that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value; and

responsive to the determination that the generated seventh token value is not equivalent to at least one of the fifth token value and the sixth token value, prevent the second request from being transmitted to the origin server.

14. The apparatus of claim 13 , wherein the instructions further cause said processor to perform the following:

modify code of the first resource to include a client-side script that, when executed by the client device, causes the client device to transmit the third token value as part of the first request.

15. The apparatus of claim 13 , wherein the third token value is to be included in one of a body of the first request and an HTTP request header of the first request.

16. The apparatus of claim 13 , wherein the second set of one or more other values include an expiration time and one or more metadata.

17. The apparatus of claim 16 , wherein the one or more metadata includes one or more of an IP address, a browser identifier, a host origin name, geo-location data, a device identifier, a user agent string, and other authentication data.

18. The apparatus of claim 13 , wherein the first request for the action to be performed is a state-changing request for the first resource.

Assignments (2)
SECURITY INTEREST Recorded May 20, 2024
From: CLOUDFLARE, INC.
To: CITIBANK, N.A.
Reel/Frame 067472/0246 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 14, 2018
From: JOHNSON, EVAN
To: CLOUDFLARE, INC.
Reel/Frame 046823/0300 →
Continuity (3)
Continuation 15696151 · Sep 5, 2017
Continuation 15432891 · Feb 14, 2017
Related Publication 20190007214A1 · Jan 3, 2019