Protecting websites from cross-site scripting
AssigneeAmazon Technologies, Inc.
InventorsBRIAN EVAN MAHER, SACHIN PURUSHOTTAM JOGLEKAR, JESPER MIKAEL JOHANSSON
Life of this patent
Estimating the term…
Abstract
Methods and systems for protecting websites from cross-site scripting are disclosed. A request for a web page comprising a web page element is received from a client. It is determined if the web page comprises a data integrity token for the web page element. It is also determined if a value of the data integrity token matches an expected value. If the web page comprises the data integrity token and if the value matches the expected value, the web page comprising the web page element is sent to the client. If the web page does not comprise the data integrity token or if the value does not match the expected value, a protective operation is performed.
Claims21
-25. (canceled)
A system, comprising:
- one or more computers configured to implement a cross-site scripting filter system, wherein the cross-site scripting filter system comprises:
- a web page rendering module configured to:
- generate a request identifier corresponding to a request for a web page according to a technique to obscure prediction of the request identifier by an outside entity;
- and
- generate an unfiltered web page based at least in part on the request, wherein the unfiltered web page comprises a protected web page element and an unprotected web page element, wherein the unfiltered web page comprises a data integrity token for the protected web page element, wherein a value of the data integrity token is calculated according to a checksum of at least the request identifier and at least a portion of the protected web page element, and wherein the data integrity token is added to the unfiltered web page via an application programming interface;
- and
- a web server configured to:
- generate a filtered web page based at least in part on the unfiltered web page, wherein the protected web page element is included in the filtered web page based at least in part on a determination that the protected web page element comprises the data integrity token and that the value of the data integrity token matches an expected value of the data integrity token, and wherein the filtered web page protects a client device from an effect of the unprotected web page element.
A computer-implemented method, comprising:
- generating a request identifier corresponding to a request for a web page according to a technique to obscure prediction of the request identifier by an outside entity;
- generating an unfiltered web page based at least in part on the request, wherein the unfiltered web page comprises a protected element and an unprotected element, wherein the unfiltered web page comprises a data integrity token for the protected element, wherein a value of the data integrity token is calculated according to a checksum of at least the request identifier and at least a portion of the protected element;
- and
- generating a filtered web page based at least in part on the unfiltered web page, wherein the protected element is included in the filtered web page based at least in part on a determination that the protected element comprises the data integrity token and that the value of the data integrity token matches an expected value of the data integrity token, and wherein the filtered web page comprises protection against the unprotected element.
A system, comprising:
- at least one processor;
- and
- a memory coupled to the at least one processor, wherein the memory stores program instructions, wherein the program instructions are executable by the at least one processor to:
- receive, from a client device, a request for a web page;
- generate an unfiltered web page based at least in part on the request, wherein the unfiltered web page comprises a protected element and an unprotected element, wherein the unfiltered web page comprises a data integrity token for the protected element, wherein a value of the data integrity token is calculated according to a checksum of at least a portion of the protected element, and wherein the data integrity token is added to the unfiltered web page via an application programming interface;
- and
- generate a filtered web page based at least in part on the unfiltered web page, wherein the protected element is included in the filtered web page based at least in part on a determination that the protected element comprises the data integrity token and that the value of the data integrity token matches an expected value of the data integrity token, and wherein the filtered web page comprises protection for the client device against the unprotected element.
Dependencies are inferred from the claim text.