Ethical hacking: what the law allows
Unauthorised access, hacking tools, written authorisation, bug bounties, reporting to ANSSI: what French law really allows a security researcher to do.
What you will learn
- Know the offences against computer systems in the French Criminal Code (Articles 323-1 to 323-8) and their penalties
- Understand why merely “remaining” in a system can be punished, even without breaking in
- Check that a penetration test authorisation really protects you, including towards the host or cloud provider
- Tell apart bug bounties, coordinated disclosure, reporting to ANSSI and whistleblower status
- Know the duty of software publishers to notify their vulnerabilities to ANSSI
At twenty, Nestor was visiting government websites without an invitation. It earned him five years in prison, which he used to complete a master’s degree in computer security. Today he only attacks with written authorisation. This chapter explains why the line between an ethical hacker and a criminal comes down to a few lines of law, and how to stay on the right side of it.
Why the law is so strict
Since the Godfrain Law of 5 January 1988, French law has protected every “automated data processing system”: a website, a server, a phone, a connected camera, a mailbox. The offences now sit in Articles 323-1 to 323-8 of the French Criminal Code (Code pénal).
The key word is “fraudulently”: it is enough to know that you are acting without the consent of whoever controls the system. Motive does not matter. Wanting to “help”, “warn” or “test” does not make the offence go away, and finding a vulnerabilityVulnerabilityA weakness in software, hardware, a configuration or a procedure that an attacker can exploit to gain unauthorised access or cause an unauthorised effect. gives you no rights over the system that contains it.
The reasoning is practical. At the moment of the intrusion, the victim cannot tell a well-meaning visitor from an attacker. Both force it to respond as if under attack, and both can break something without meaning to.
The offences, article by article
France’s Ministry of the Interior orientation and programming law of 24 January 2023 (LOPMI) increased the penalties. Here is the law as it stands on 2 October 2026.
| French Criminal Code | What is punished | Maximum penalty (individual) |
|---|---|---|
| 323-1, paragraph 1 | Fraudulently accessing or remaining in all or part of a system | 3 years and €100,000 |
| 323-1, paragraph 2 | The same, where data is deleted or modified, or the system’s operation is impaired | 5 years and €150,000 |
| 323-1, paragraph 3 | The same, against a personal data system operated by the State | 7 years and €300,000 |
| 323-2 | Obstructing or distorting how a system works (a denial-of-service attack, for example) | 5 years and €150,000 |
| 323-3 | Fraudulently introducing, extracting, holding, copying, transmitting, deleting or modifying data | 5 years and €150,000 |
| 323-3-1 | Holding or distributing tools designed for these offences, without a legitimate reason | Penalties for the offence concerned |
| 323-4 | Taking part in a group or agreement preparing these offences | Penalties for the most serious offence |
| 323-4-1 | Committing these offences as an organised gang | 10 years and €300,000 |
| 323-4-2 | Exposing others to a risk of death or serious injury, or obstructing emergency services | 10 years and €300,000 |
| 323-7 | Attempt | Same penalties as the offence |
For Articles 323-2 and 323-3, the penalty also rises to 7 years and €300,000 when the target is a State personal data system. Additional penalties apply (a ban on practising, confiscation of equipment, Article 323-5) and a company can face a fine up to five times higher (Article 323-6). Finally, Article 323-8 only exempts certain operations by State intelligence services abroad: there is no exception for security researchers.
Remaining in a system: the lesson of the “Bluetouff” case
Court of Cassation (France’s highest court), Criminal Chamber, 20 May 2015, No. 14-81.336. A blogger had used a search engine to find documents on the extranet of ANSES, the French food and health safety agency, which were reachable because of a technical failure. Acquitted of unlawful access, he was convicted of fraudulently remaining in the system and of data theft: he had carried on browsing and downloaded the files after realising that the site was protected by a login. The Court of Cassation dismissed his appeal.
There are two lessons. First, an open door is not an invitation: as soon as you realise you are somewhere you should not be, every extra minute counts against you. Second, copying data is a separate offence: Article 323-3 expressly punishes extracting, holding or transmitting it.
Tools and the “legitimate reason”
Article 323-3-1 punishes anyone who, “without a legitimate reason, in particular research or computer security”, holds, offers or makes available a program or device designed to commit these offences.
- A port scanningPort scanningA technique that probes a machine’s network “doors” to find out which ones are open and which services answer behind them. tool, a testing framework or a proof-of-concept exploitExploitA program or technique that takes advantage of a specific vulnerability to make a system do something it should not: run code, bypass authentication, read data. is not illegal in itself.
- The legitimate reason must be something you can prove: an engagement contract, a job description, a training lab, a documented research project.
- Carelessly publishing a ready-to-use attack tool may be treated as making it available. Where research ends depends on the context, and it is for the judge to decide.
Written authorisation: your only shield
A penetration testPenetration testing (pentest)A simulated attack, carried out by authorised specialists, to find the weaknesses in a system before a real attacker exploits them. is lawful only because whoever controls the system authorises it. That authorisation must be written, precise and given by the right person, meaning someone who can genuinely commit the organisation with respect to those systems.
What it must contain
The PASSI v2.2 framework from ANSSI, France’s national cybersecurity agency, which governs the qualification of security audit providers, recommends an authorisation form signed by the audited organisation, stating at least:
- the list of targets (IP addresses, domain names, URLs);
- the IP addresses the tests will come from;
- the dates and times of the tests, and how long the authorisation lasts.
Add the rules of engagementRules of engagement (scope and mandate)A signed document setting out what a tester is allowed to do: target systems, dates, permitted and forbidden techniques, emergency contacts and what to do if something unexpected happens.: testing mode (black, grey or white boxBlack, grey and white box testingHow much information testers receive before an audit: nothing (black box), a user account or partial documentation (grey box), or everything, source code included (white box).), forbidden actions (denial of service, deleting or exfiltrating real data), emergency contacts, what to do about a critical flaw, and what happens to collected data at the end of the engagement.
Third parties: hosts, cloud and SaaS
You can only authorise what you control. Under the PASSI framework, the agreement must state that the client holds all rights over the scope or has obtained the consent of the third parties whose systems are part of it. It also advises against testing shared environments without the host’s consent.
Is your website with a hosting provider, your email in the cloud, your CRM with a SaaS vendor? Read their terms: most regulate testing, and some forbid it on shared infrastructure. It is for the same reason that KrakenShield requires verified authorisation before any active action on a domain.
Employees: an account is not a licence
An employee who uses their access to explore areas that have nothing to do with them can also end up fraudulently remaining in a system. Having a login does not give you the right to go everywhere. Testing your employer’s security requires the same written authorisation as for an outside provider.
Bug bounties: a contract, not immunity
A bug bounty programmeBug bountyA programme in which an organisation invites security researchers to look for flaws within a defined scope, and rewards them for each valid vulnerability reported. invites researchers to find flaws within a defined scope in exchange for a reward. In France, no law gives it any special status: it is a purely contractual arrangement. The programme’s terms (scope, permitted techniques, confidentiality, delay before publication) act as the authorisation, and only within those limits. French platforms such as YesWeHack and Yogosha act as intermediaries between organisations and researchers.
Many programmes include a “safe harbour” clause, in which the organisation promises not to pursue researchers who follow the rules. That is valuable, but limited.
- It only binds the organisation that signs it, not a host or subcontractor whose systems might be affected.
- It does not bind the public prosecutor, who remains free to bring charges.
- It disappears the moment you step outside the scope or the rules.
The Cyber Resilience Act even mentions bug bounties as one way for manufacturers to encourage vulnerability reports as part of their coordinated disclosure policy.
Reporting a flaw: the right channels
Did you stumble on a flaw without looking for it? Stop, write down what you saw, and report it through a channel designed for that purpose.
Reporting to ANSSI (French Defence Code, Article L2321-4)
Article L2321-4 of the French Defence Code. A person who, in good faith, passes information about a vulnerability in a computer system to ANSSI alone benefits from two guarantees: ANSSI is not required to refer the facts to the prosecutor under Article 40 of the French Code of Criminal Procedure (the duty of public officials to report offences), and it keeps the reporter’s identity confidential, along with the circumstances of the report. This is not immunity: the victim can still file a complaint, and the way the flaw was found remains subject to the Criminal Code.
Reports go to CERT-FR, ANSSI’s incident response team, which can assess the risk and alert the host or the system owner. This channel protects your identity, not any intrusion you may have made.
Coordinated disclosure
Coordinated vulnerability disclosure happens in three stages: the researcher privately warns the organisation, the organisation fixes the flaw within an agreed time, and the flaw is then made public, often with a CVECVEA unique public identifier given to a known vulnerability (for example CVE-2021-44228), so that everyone can talk about the same flaw without ambiguity. identifier.
- A disclosure policy, published by the organisation, explains how to report, what it commits to and what it expects from researchers. A
security.txtfile (RFC 9116) at the root of a website says where to write. - NIS2 (Article 12) requires each Member State to designate a coordinating CSIRTCSIRT / CERT (incident response team)A team dedicated to responding to security incidents for a given constituency (a company, a sector, a region, a country), which warns, advises and coordinates the response., a trusted intermediary between researchers and vendors, and tasks ENISA with a European vulnerability database. Its Recital 60 encourages Member States to limit researchers’ criminal and civil exposure; France has not, to date, adopted a general regime to that effect.
- The Cyber Resilience Act requires manufacturers to have a coordinated disclosure policy (full application on 11 December 2027) and, since 11 September 2026, to report actively exploited flaws.
The duty of software publishers (French Defence Code, Article L2321-4-1)
Since the military programming law of 1 August 2023, software publishers supplying a product in France, or to French companies, must notify ANSSI of any significant vulnerability in that product, or any incident on their own systems likely to affect it, together with an analysis of its causes and consequences. They must then inform their users within the time set by ANSSI. Failing that, ANSSI can order them to do so, or even make the information public.
Decree No. 2024-421 of 10 May 2024, in force since 1 June 2024, sets out the criteria for what counts as significant (number of users, products that embed the software, technical impact, actual or imminent exploitation) and gives users at least ten working days’ notice, except in urgent cases. A publisher is anyone who designs or commissions software and makes it available, free or paid, which on the face of it includes SaaS vendors.
Whistleblowers: what it covers, and what it does not
Since the law of 21 March 2022, a whistleblower under French law is an individual who reports or discloses, without direct financial reward and in good faith, information about a crime, an offence, a threat or harm to the public interest, or a breach of the law (Article 6 of the Sapin II Law of 9 December 2016). Outside a work context, they must have had personal knowledge of it.
This status protects against retaliation. Article 122-9 of the French Criminal Code also gives criminal immunity to a whistleblower who discloses a legally protected secret under the conditions set by law, or who takes documents that they came to know lawfully.
- What it covers: an employee who discovers at work that their company is hiding a data leak, and who reports it through the proper channels (internally, or to an authority such as the CNIL, France’s data protection authority).
- What it does not cover: breaking into a system to look for evidence. Information obtained through unauthorised access was not obtained lawfully, and the intrusion remains a crime.
What you must never do
Whether you are an independent researcher or a curious employee, these actions put you on the wrong side of the line.
- Testing a system without written authorisation, even “just to see”.
- Carrying on exploring once you realise you have no business being there.
- Downloading, copying or keeping data, even “to keep as proof”.
- Using credentials you found, guessed or borrowed from a colleague.
- Launching a mass scan or a tool that could slow a service down.
- Stepping outside a bug bounty programme’s scope, even by a single address.
- Asking for money in exchange for your silence: that is blackmail or extortion, punished far more severely than the intrusion.
- Publishing a flaw before it is fixed, without coordination.
Information, not legal advice. This chapter describes French law as it stands on 2 October 2026, for educational purposes. Every situation is different: before a test, a bug bounty programme or a sensitive report, get advice from a lawyer.
Key takeaways
- Fraudulently accessing or remaining in a system carries 3 years in prison and a €100,000 fine, rising to 7 years and €300,000 depending on the circumstances, and 10 years for an organised gang.
- Good intentions do not erase the offence: only a written, precise authorisation signed by someone who genuinely controls the systems makes a test lawful.
- A bug bounty is a contract: step outside its scope or its rules and the protection disappears.
- Reporting a flaw to ANSSI in good faith (French Defence Code, Article L2321-4) protects your identity, but it does not make you untouchable.
- Software publishers must notify ANSSI of significant vulnerabilities, and since 11 September 2026 manufacturers must report actively exploited flaws.
Were you paying attention?
Three questions to check, no score, no account.
For information only, accurate as of the date shown. This is not legal advice: for a specific situation, consult a lawyer.
Sources
- Légifrance, French Criminal Code, Articles 323-1 to 323-8 (offences against automated data processing systems, in French)
- Légifrance, French Criminal Code, Article 323-1 (as amended by the law of 24 January 2023, in French)
- Légifrance, French Criminal Code, Article 323-3 (in French)
- Légifrance, French Criminal Code, Article 323-3-1 (tools, legitimate reason, in French)
- Légifrance, French Criminal Code, Article 323-4-1 (organised gang, in French)
- Légifrance, Law No. 2023-22 of 24 January 2023 on the orientation and programming of the Ministry of the Interior (LOPMI, in French)
- Légifrance, Court of Cassation, Criminal Chamber, 20 May 2015, No. 14-81.336 (in French)
- ANSSI, PASSI v2.2 requirements framework (service agreement, authorisation form, in French)
- Légifrance, French Defence Code, Article L2321-4 (reporting vulnerabilities to ANSSI, in French)
- Légifrance, French Defence Code, Article L2321-4-1 (duty of software publishers, in French)
- Légifrance, Decree No. 2024-421 of 10 May 2024 (Articles R2321-1-16 to R2321-1-19 of the Defence Code, in French)
- CERT-FR (ANSSI), contact and online vulnerability reporting (in French)
- Directive (EU) 2022/2555 (NIS2), Article 12 and Recital 60 (coordinated vulnerability disclosure)
- Regulation (EU) 2024/2847 (Cyber Resilience Act), Article 14 and Annex I
- IETF, RFC 9116, A File Format to Aid in Security Vulnerability Disclosure (security.txt)
- Légifrance, Law No. 2022-401 of 21 March 2022 to improve the protection of whistleblowers (in French)
- Légifrance, French Criminal Code, Article 122-9 (whistleblower criminal immunity, in French)