Patent ID: 8181246

Claim:
A method for detecting and blocking Javascript hijacking attacks, comprising: checking, by a secure gateway connected to at least a trusted server and communicatively coupled to a client, if an incoming request does not belong to a valid session established between a client and a trusted server and transferring the incoming request to the trusted server in response to the incoming request not belonging to the valid session thereby completing the method; otherwise, when said incoming request does belong to the valid session, checking if a Referer header field of said incoming request includes a domain name that is of a protected web-site hosted by the trusted server; marking said incoming request as suspicious, when said incoming request does not include the domain name; transferring the suspicious incoming request to the trusted server; checking if a respective response of said suspicious incoming request includes a script code; and taking a preventive action responsive to a user input when said respective response includes the script code by skipping processing of the respective response based on the user input, such that a hijacking attack to gain access to sensitive information conveyed to the client is prevented.