Liability For Cross-Site Scripting Exposure Affecting Sessions
LEGAL LIABILITY FOR CROSS-SITE SCRIPTING (XSS) EXPOSURE AFFECTING USER SESSIONS AND AUTHENTICATION SECURITY
1. INTRODUCTION
Liability for cross-site scripting (XSS) exposure affecting sessions arises when a website, banking platform, financial institution or digital service contains a security vulnerability that allows attackers to inject and execute malicious scripts in users' browsers. Such scripts may steal session identifiers, compromise authentication tokens, hijack active sessions, access confidential information or perform unauthorised transactions using the victim's authenticated account.
Cross-site scripting is particularly serious in banking and financial services because an attacker who obtains a valid session token may gain access to customer accounts without necessarily knowing the customer's password.
Legal liability may arise from inadequate cybersecurity safeguards, negligent software development, failure to conduct security assessments, insufficient monitoring, improper incident response or failure to protect personal information.
In Spain, XSS-related liability is governed by Spanish civil and criminal law, the General Data Protection Regulation (GDPR), the Spanish Organic Law 3/2018 on Personal Data Protection and Guarantee of Digital Rights (LOPDGDD), and applicable European cybersecurity regulations.
2. LEGAL AND REGULATORY FRAMEWORK
A. General Data Protection Regulation (GDPR)
The GDPR establishes obligations for organisations processing personal information.
Article 5(1)(f): Requires integrity and confidentiality of personal data.
Article 24: Requires controllers to implement appropriate organisational measures to ensure compliance.
Article 25: Establishes data protection by design and by default.
Article 32: Requires appropriate technical and organisational security measures.
Articles 33 and 34: Establish personal data breach notification and communication obligations.
Article 82: Provides the right to compensation for material or non-material damage resulting from GDPR infringements.
Where XSS compromises personal data through session hijacking, the organisation may face regulatory and compensation-related consequences if the applicable legal requirements are established.
B. Spanish Organic Law 3/2018 (LOPDGDD)
This legislation supplements the GDPR within the Spanish legal framework and establishes national provisions concerning personal data protection and enforcement.
C. NIS2 Directive (EU) 2022/2555
The NIS2 Directive establishes cybersecurity risk-management and incident-reporting obligations for entities within its scope.
Relevant provisions include:
Article 20: Management accountability.
Article 21: Cybersecurity risk-management measures.
Article 23: Incident-reporting obligations.
Its application depends on the organisation's sector, size, status and applicable national implementation.
D. Spanish Criminal Code
The Spanish Criminal Code may apply where XSS exploitation involves unauthorised access, interception, fraudulent activity or manipulation of computer systems.
Article 197 addresses certain unlawful activities involving discovery and disclosure of secrets and personal information.
Articles 248 and following address fraud-related offences, subject to the applicable statutory elements.
3. CIRCUMSTANCES CREATING LIABILITY
A. Session Hijacking Through XSS
An attacker injects malicious JavaScript into a vulnerable website and uses it to obtain or misuse an authenticated user's session information.
Where an organisation fails to implement appropriate security controls, it may face liability for resulting personal-data breaches.
B. Inadequate Input Validation
Websites that fail to validate and safely encode user-generated content may allow malicious scripts to execute within legitimate web pages.
C. Absence of Secure Cookie Attributes
Failure to configure appropriate HttpOnly, Secure and SameSite cookie attributes may increase the risk of session compromise.
However, HttpOnly alone does not eliminate XSS risks because malicious scripts may still perform actions through the victim's authenticated browser.
D. Inadequate Content Security Policy
Failure to implement an appropriate Content Security Policy (CSP) may increase exposure to script injection and execution.
E. Failure to Conduct Security Testing
Financial institutions and digital service providers may face liability where they neglect reasonable vulnerability assessments, penetration testing and security reviews.
F. Delayed Incident Response
Failure to investigate session compromise, invalidate affected tokens, contain the vulnerability or notify affected individuals where legally required may create additional regulatory exposure.
G. Third-Party Software Vulnerabilities
Where third-party scripts, plugins or software components introduce XSS vulnerabilities, contractual liability and data-protection responsibilities may arise depending on the parties' respective roles and obligations.
4. IMPORTANT JUDICIAL DECISIONS
1. Google Spain SL v Agencia Española de Protección de Datos (AEPD) and Mario Costeja González (Case C-131/12, 2014)
The Court of Justice of the European Union examined the responsibilities of search-engine operators in processing personal information.
The judgment clarified the application of European data-protection principles to organisations processing personal data.
Legal principle: Organisations processing personal information must comply with applicable data-protection obligations.
Relevance: Analogous authority for understanding organisational responsibility when digital systems expose personal information.
2. Wirtschaftsakademie Schleswig-Holstein GmbH v Unabhängiges Landeszentrum für Datenschutz Schleswig-Holstein (Case C-210/16, 2018)
The CJEU considered the joint controllership responsibilities of organisations operating Facebook fan pages.
The Court explained that determining responsibility for personal-data processing depends on the organisation's actual involvement and influence.
Legal principle: Multiple organisations may share data-protection responsibilities depending on their respective roles.
Relevance: Relevant to XSS incidents involving website operators, analytics providers and third-party service providers.
3. Fashion ID GmbH & Co. KG v Verbraucherzentrale NRW eV (Case C-40/17, 2019)
The CJEU examined the responsibility of a website operator that incorporated a Facebook social plugin, resulting in the collection and transmission of visitors' personal information.
The Court recognised that website operators may have joint-controller responsibilities for particular stages of data processing.
Legal principle: Website operators cannot automatically avoid data-protection responsibilities by relying on third-party technologies.
Relevance: Analogous authority concerning liability for vulnerabilities introduced through third-party scripts and embedded website components.
4. Österreichische Post AG (Case C-300/21, 2023)
The CJEU examined the requirements for compensation under Article 82 GDPR.
The Court held that an infringement alone does not automatically establish a right to compensation. The claimant must demonstrate an infringement, damage and a causal connection between them. No minimum seriousness threshold applies to non-material damage.
Legal principle: Actual material or non-material damage and causation are necessary for GDPR compensation.
Relevance: Particularly important where XSS exposure results in session hijacking, financial loss, identity misuse or proven distress.
5. Natsionalna agentsia za prihodite (National Revenue Agency) (Case C-340/21, 2023)
The CJEU considered a personal-data breach resulting from a cyberattack against a Bulgarian public authority.
The Court clarified that a cyberattack by a third party does not automatically exempt a data controller from responsibility.
It also addressed the assessment of appropriate security measures and the possibility of compensation for fear of potential misuse of personal data.
Legal principle: Organisations must demonstrate that their security measures were appropriate to the risks; a third-party cyberattack is not automatically a defence.
Relevance: Highly analogous authority for XSS-related session compromise caused by external attackers.
6. IAB Europe v Gegevensbeschermingsautoriteit (Case C-604/22, 2024)
The CJEU examined the interpretation of personal-data processing and controllership in the context of online advertising and technical digital identifiers.
The Court addressed when an organisation may qualify as a controller in relation to technical information processed through digital systems.
Legal principle: Data-protection responsibility depends on the organisation's actual role in determining the purposes and means of processing.
Relevance: Analogous authority for allocating responsibility among website operators, advertising technology providers and other digital service providers involved in processing session-related information.
These decisions concern GDPR accountability, cybersecurity breaches and digital-data processing. They are analogous authorities rather than judgments directly deciding liability for XSS-based session hijacking.
5. TYPES OF LEGAL LIABILITY
A. Civil Liability
Under Article 82 GDPR, affected individuals may claim compensation for material or non-material damage caused by a GDPR infringement, provided the necessary legal elements are established.
B. Administrative Liability
Under Article 83 GDPR, supervisory authorities may impose administrative fines for relevant infringements, including failures to implement appropriate security measures.
C. Criminal Liability
Attackers who unlawfully access systems, steal credentials, misuse session tokens or conduct fraudulent transactions may face criminal prosecution under applicable Spanish criminal law.
D. Contractual Liability
Banks and digital service providers may face contractual claims where inadequate security controls violate their contractual obligations to customers or business partners.
E. Third-Party Liability
Software developers, hosting providers and technology vendors may face contractual or other legal liability where their acts or omissions contribute to the vulnerability. Responsibility depends on their contractual role, applicable duties and proven conduct.
6. TECHNICAL AND ORGANISATIONAL COMPLIANCE MEASURES
Organisations should implement the following safeguards:
Apply context-sensitive output encoding to prevent malicious script execution.
Use secure input validation and sanitisation procedures.
Configure session cookies with HttpOnly, Secure and appropriate SameSite attributes.
Implement restrictive Content Security Policies.
Rotate session identifiers after authentication and privilege changes.
Establish short and risk-appropriate session expiration periods.
Use robust session invalidation and token-revocation mechanisms.
Conduct regular penetration testing and vulnerability assessments.
Monitor suspicious session activity and unauthorised authentication patterns.
Maintain incident-response and personal-data breach notification procedures.
Audit third-party scripts, plugins and software dependencies.
Maintain records of security assessments and remediation activities.
7. CONCLUSION
Liability for cross-site scripting exposure affecting user sessions is an important issue in cybersecurity, banking regulation and personal-data protection. XSS vulnerabilities may allow attackers to compromise authenticated sessions, access confidential information and conduct unauthorised activities. Under the GDPR and Spanish legal framework, organisations must implement appropriate technical and organisational security measures to protect personal information. A third-party cyberattack does not automatically eliminate an organisation's responsibility. However, compensation and regulatory liability depend on the applicable legal requirements, including the existence of an infringement, damage and causation where required. Effective input validation, secure session management, continuous security testing and timely incident response are therefore essential to preventing legal exposure.

comments