In brief. A company can be held civilly liable for a cyberattack if it failed to implement the security measures appropriate to its activity and that failure contributed to the harm suffered by clients, employees or third parties. Where the incident involves personal data, the burden falls on the company to demonstrate that its measures were adequate (Court of Justice of the EU (CJEU), Case C-340/21). The limitation period for bringing a claim is 5 years where a contract exists, and 1 year where it does not.
Article written by Conesa Legal
A cyberattack can make a company both a victim and a liable party
A phishing email, a system intrusion or a ransomware attack can bring a business to a standstill and cause harm to clients, employees or suppliers. The key question is not only who carried out the attack, but whether the company had taken the measures reasonably expected of it and whether its failure to do so contributed to the damage.
Being the victim of an attack does not automatically make the company liable. But being targeted by a criminal does not automatically shield it from liability towards third parties either.
Liability rests on three elements: a breach of obligation or negligent conduct, damage, and a causal link between the two. These are the requirements set out in Articles 1101, 1104 and 1902 of the Spanish Civil Code.
The affected company will typically invoke Article 1105 of the Spanish Civil Code as a defence: no one is liable for unforeseeable or unavoidable events. This defence holds where the attack could not reasonably have been foreseen or prevented. It does not hold where the risk was well-known, as is the case with phishing or ransomware, and the company failed to take the steps expected of it.
Who can bring a claim, and within what timeframe
| Claimant | Against whom | Legal basis | Limitation period | Burden of proof |
|---|---|---|---|---|
| Client with a contract | The company | Breach of contract (Arts. 1101 and 1104 of the Spanish Civil Code) | 5 years (Art. 1964.2 of the Spanish Civil Code) | The client must prove the breach, the damage and the causal link |
| Third party without a contract | The company | Tort liability (Art. 1902 of the Spanish Civil Code) | 1 year from the date the damage became known (Art. 1968.2 of the Spanish Civil Code) | The third party must prove fault, damage and the causal link |
| Individual whose personal data has been affected | The data controller or the data processor | Art. 82 GDPR | Depends on the action brought | The company must prove that its measures were appropriate |
| The affected company | Its technology provider | Service contract (Arts. 1101 et seq. of the Spanish Civil Code) | 5 years (Art. 1964.2 of the Spanish Civil Code) | The company must prove what the provider was required to do and in what respect it failed |
Clients and affected third parties
A client may bring a claim if the incident constitutes a breach of contract and causes them loss attributable to the company. A third party with no contractual relationship may rely on tort liability, though the limitation period is significantly shorter. This difference in time limits is the first thing to check when a claim is received.
The company against its technology provider
Outsourcing IT does not turn the provider into an absolute guarantor against incidents ever occurring. To bring a claim against them, it is necessary to identify precisely what they were required to do: maintain systems, manage backups, monitor alerts, or deliver a specific service. It must then be demonstrated what obligation they failed to meet and how that failure contributed to the loss.
The contract, technical annexes, support tickets and communications carry as much weight as an expert IT report. It is also worth reviewing, within the commercial contracts with providers, the clauses that limit the provider's liability: these typically cap the amount of compensation payable, but do not shield the provider against wilful breach.
Individuals affected by a data breach
Article 82 of the GDPR recognises the right to compensation for material or non-material damage resulting from an infringement of the Regulation. The Court of Justice of the European Union has clarified how this provision applies:
- An infringement alone is not sufficient. The individual must establish that damage has occurred, although it need not be serious (C-300/21).
- A third-party attack does not in itself prove that the security measures were inadequate, but the burden of demonstrating that they were adequate rests with the company (C-340/21).
- Fear of misuse of personal data may constitute compensable non-material damage (C-340/21).
A fine imposed by the Spanish Data Protection Agency and a compensation award are two separate matters. The fine is collected by the public authorities; compensation is paid to the person who suffered the harm, and each follows its own distinct procedure.
What cybersecurity measures are required of a company
The law does not impose a fixed list of tools. It requires measures appropriate to the risk: what matters is whether the company assessed the risks associated with its activities, the information it handles, and the foreseeable consequences of an incident.
Where personal data is involved, Article 32 of the GDPR requires the implementation of technical and organisational measures to ensure an appropriate level of security. In Spain, Article 28 of the Spanish Data Protection and Digital Rights Act (LOPDGDD) adds that those measures must be demonstrable. It is not enough to purchase technology: it must be properly implemented, maintained, and documented. The size of the company does not reduce these obligations.
The measures most closely scrutinised following an incident are:
- access and privilege management, and multi-factor authentication;
- system updates and vulnerability patching;
- backups and regular recovery testing;
- email security and staff training against fraud;
- contracts with technology providers and oversight of their work;
- a written incident response procedure.
Some companies are also subject to the NIS2 Directive, which imposes enhanced risk management and reporting obligations. We explain who is affected in our guide on cybersecurity obligations under the NIS2 Directive. Its application depends on the sector, type of entity, and size, and must be assessed on a case-by-case basis.
The employee who opened the fraudulent email
Many incidents begin with an employee clicking a link. From a civil liability perspective, Article 1903 of the Spanish Civil Code holds a company liable for damage caused to third parties by its employees in the course of their duties. The company can only escape liability if it proves that it exercised due diligence to prevent the harm.
This is why internal training and protocols serve a dual purpose: they reduce risk and act as evidence if a claim arises.
Against the employee, the company may consider disciplinary action, but an isolated mistake rarely justifies dismissal. The assessment depends on whether clear instructions were in place, whether the employee received training, and whether the conduct is repeated. The rules on the use of digital devices required under Article 87 of the Spanish Data Protection and Digital Rights Act (LOPDGDD) are a key factor here.
What to do in the first 72 hours
The technical and legal responses must be coordinated from the outset.
- Contain the incident without destroying evidence. The technical team leads the security response and documents every change made.
- Preserve evidence. Contracts, access logs, original emails, alerts, tickets, available backups, and communications with the service provider.
- Notify the Spanish Data Protection Agency (AEPD) if personal data is involved. Article 33 of the GDPR requires notification within a maximum of 72 hours of becoming aware of the breach, unless it is unlikely to pose a risk to individuals. If the risk is high, affected individuals must also be informed (Art. 34 GDPR).
- Review all other notification obligations. Client contracts, cyber insurance policy, and, if applicable, the NIS2 framework.
- File a criminal complaint. The attack may constitute computer fraud or criminal damage to computer systems. Filing a complaint supports the investigation and is typically required by insurers.
- Reconstruct the sequence of events. What happened, when it was detected, what safeguards were in place, and how the company responded.
- Record costs from day one. Keep a clear distinction between the costs of remedying the incident and any future improvements.
A security incident demands fast decisions with significant legal consequences. If your company is currently managing one, we can help you prioritise the right steps.
The role of cyber insurance
A cyber risk policy can cover response costs, loss of profits and third-party claims. It is worth reviewing the policy before any incident occurs to understand its requirements: notification deadlines, minimum security measures and approved service providers. Failing to comply with these conditions may reduce or eliminate cover.
Where the insurer pays out compensation, it may subsequently bring a claim against the party responsible for the damage, for example, the technology provider (Art. 43 of the Insurance Contracts Act).
How damages from a cyberattack are calculated
Article 1106 of the Spanish Civil Code distinguishes between actual loss suffered (damnum emergens) and lost profits (lucrum cessans). In a contractual claim, Article 1107 limits compensation to losses that were foreseeable at the time the contract was signed, unless there is fraud or wilful misconduct. Each head of loss must be set out separately and without duplication.
Actual loss: the direct cost of the incident
This covers reasonable expenditure on forensic analysis, file recovery, service restoration and advice. All costs must be substantiated with invoices and reports and must be directly linked to the breach.
A full system overhaul is not necessarily compensable. It is necessary to separate the cost of restoring the previous state of affairs from any upgrade that the company would have required in any event.
Lost profits: the income that was not earned
A drop in turnover does not equal lost profit. The expert must reconstruct the scenario as it would have unfolded without the incident, identify the transactions that were frustrated and deduct the costs the company saved as a result.
Example. A ransomware attack brings down the systems of a distribution company for five days. The company turns over an average of €40,000 per day at a 15% margin. The lost profit is not €200,000, it is the margin lost on the sales that were never recovered. If half of the orders were fulfilled the following week, the starting figure is approximately €15,000.
Historical accounts, cancelled orders, client communications, and the actual duration of the disruption are all useful evidence. Other potential causes, such as seasonal trends or broader market developments, must also be ruled out.
Non-material and reputational damages
An individual's distress at having their personal data exposed is not the same as a company's loss of commercial reputation. Each is assessed according to who has suffered the harm and what legal action has been brought.
There is no fixed tariff per incident: neither the number of files affected nor the duration of the outage alone determines the amount of compensation.
How to prepare a legal claim
Before bringing proceedings, it is essential to identify the right cause of action, verify the limitation period and jurisdiction, and attempt an appropriate dispute resolution process. Since the Organic Law 1/2025, attempting prior negotiation is a mandatory requirement for a civil claim to be admitted (Art. 5). A simple payment demand does not always satisfy this requirement.
The claim must set out clearly what is being claimed and why. Technical evidence explains the cause; accounting evidence justifies the amount. Digital files and records must be preserved in a way that allows their integrity to be verified, as the Civil Procedure Act admits them as evidence (Arts. 326 and 384) and allows the opposing party to challenge them.
Frequently asked questions
Can an SME be held liable for a cyberattack?
Yes. Size does not remove the duty of care or the security obligations that apply when personal data is processed. What changes is the level of measures required, which is calibrated to the actual risk of the activity in question.
Does having antivirus software eliminate liability?
No. Antivirus software is one measure, not proof of due diligence. What is assessed is the full set of measures in place, their adequacy to the risk, and how they actually functioned, and where personal data is involved, it is the company that bears the burden of demonstrating this (Court of Justice of the EU (CJEU), C-340/21).
How long do you have to bring a claim?
Five years if there is a contract (Art. 1964.2 of the Spanish Civil Code) and one year from the date the damage becomes known if there is not (Art. 1968.2 of the Spanish Civil Code).
Must the attack be reported to the Spanish Data Protection Agency (AEPD)?
Yes, if it involves personal data and may pose a risk to individuals: within a maximum of 72 hours of becoming aware of it (Art. 33 GDPR).
Can you bring a claim against the IT provider?
Yes, provided you can identify which obligation the provider failed to meet and how that failure contributed to the damage. Proving that an attack took place is not enough, you must link the attack to a specific failure in the contracted service.
Can you bring a claim even if the attacker is unknown?
Yes. The civil liability of the company or the provider does not depend on identifying the perpetrator. These are two separate matters: the criminal investigation seeks to identify the offender, while the civil claim examines whether someone failed in their duty of security.
Can the employee who opened the fraudulent email be disciplined?
It depends. If clear instructions and training were in place, a proportionate disciplinary measure may be warranted. An isolated mistake will rarely justify dismissal.
Prevention is also preparation for your defence
Legal cybersecurity is about reducing risk and being able to demonstrate that reasonable measures were taken. Reviewing supplier contracts, insurance policies, internal protocols, and device usage policies before an incident occurs puts you in a much stronger position when a crisis arises.
If you would like to review your company's position in the event of an incident, or to pursue a claim for damages suffered, our team is ready to help.
