🕑 Estimated reading time: 5 minutes | Last updated: July 23, 2024
Ethical hacking is legal when you have clear authorisation from the system owner, stay within the agreed scope, and follow the rules of engagement. Without permission, probing or accessing someone else’s system can be a crime under laws such as the US Computer Fraud and Abuse Act, the UK Computer Misuse Act 1990 and Nigeria’s Cybercrimes Act 2015, even if you mean well. Bug bounty programmes and vulnerability disclosure policies with safe harbour language give researchers a structured, authorised way to test and report flaws.

Plenty of curious young people in Lagos, Nairobi and London teach themselves to hack, and some of them go on to excellent careers protecting companies. The line between a career and a criminal record is thinner than many realise, and it is drawn by one word: permission.
Ethical hackers, also called white-hat hackers or penetration testers, use the same techniques as criminals to find weaknesses in systems so they can be fixed. Their work makes the internet safer. Yet many people are surprised to learn that the law usually does not distinguish between a “good” and a “bad” hacker based on intentions alone. What matters most is authorisation.
Below, we explain when ethical hacking is legal, the risks of testing without permission, and how bug bounty programmes and safe harbour policies work.
Table of Contents
Authorisation Is Everything
Most cybercrime laws are built around the idea of unauthorised access. The US Computer Fraud and Abuse Act prohibits accessing a computer “without authorization.” The UK Computer Misuse Act 1990 makes it an offence to cause a computer to perform any function with intent to secure unauthorised access. Nigeria’s Cybercrimes Act 2015 criminalises unlawful access to a computer system. None of these laws contains a general defence for people who meant to help.
That means scanning a company’s website for vulnerabilities, trying default passwords on a router you do not own, or exploiting a flaw “just to prove it exists” can all be offences if you do not have permission, even if you report the problem afterwards and cause no damage.
Professional Penetration Testing
Professional penetration testers work under a written contract with the system owner. A proper engagement normally includes:
- A statement of work and scope listing exactly which systems, IP ranges, applications and locations may be tested.
- Rules of engagement covering permitted techniques, testing windows, prohibited actions (such as denial-of-service or social engineering without consent) and how sensitive data must be handled.
- Written authorisation from someone with authority to grant it. If systems are hosted by a cloud provider or managed by a third party, their policies or consent may also be required.
- Confidentiality and data protection terms, because testers may encounter personal data.
- Emergency contacts in case testing causes an outage or uncovers evidence of an active breach.
Staying strictly within scope is essential. Testing a system outside the agreed list can expose the tester to criminal and civil liability.
How Bug Bounty Programmes Work
A bug bounty programme is a public or private invitation from an organisation for independent researchers to look for vulnerabilities in specified assets, in exchange for recognition or cash rewards. Many are run through platforms such as HackerOne, Bugcrowd and Intigriti, and they are offered by technology companies, banks, governments and even militaries.
The programme policy acts as the authorisation. It typically sets out:
- which domains, apps or products are in scope and which are out of scope;
- which vulnerability types qualify for rewards;
- prohibited behaviour, such as accessing other users’ data beyond what is needed to demonstrate an issue, degrading service or social engineering staff;
- how and where to report findings and how long to wait before any public disclosure.
Safe Harbour Language
Good programmes and vulnerability disclosure policies (VDPs) include a safe harbour clause. In it, the organisation commits that it will consider research conducted in accordance with the policy to be authorised, will not pursue legal action against researchers who follow it, and in some cases will support them if a third party brings a claim. Community projects such as disclose.io publish standard safe harbour wording that organisations can adopt.
Safe harbour statements are not a blanket immunity. They protect only conduct that follows the policy, they bind only the organisation that issues them, and they cannot prevent a prosecutor acting on a complaint from someone else. Still, they significantly reduce risk.
Legal Reforms Supporting Researchers
- United States: In 2022 the Department of Justice announced that federal prosecutors should not charge good-faith security research under the CFAA. The US Copyright Office has also granted exemptions under the Digital Millennium Copyright Act that allow good-faith security research involving circumvention of technical protection measures in many situations.
- Belgium: Since 2023, Belgian law has provided a framework allowing ethical hackers to look for vulnerabilities in Belgian organisations’ systems without prior permission, provided they meet strict conditions, including acting without fraudulent intent, doing no more than necessary and reporting promptly to the national cybersecurity centre.
- United Kingdom: Security professionals have campaigned for a statutory public-interest defence in the Computer Misuse Act, and the government has consulted on reforms, but as of mid-2024 no general defence exists.
- Nigeria and much of Africa: There is no specific legal safe harbour for unsolicited security research, so researchers should only test systems where they have explicit permission or a published programme.
What To Do If You Stumble on a Vulnerability
- Stop. Do not continue exploring, download data or try to escalate access.
- Document what you observed and how, without accessing anything further.
- Look for an official channel, such as a security.txt file, a VDP page or a bug bounty listing.
- Report privately and give the organisation reasonable time to fix the problem.
- Never demand payment in return for keeping quiet; that can be treated as extortion.
- If no channel exists, consider reporting through a national CERT, which can contact the organisation for you.
Building a Legal Ethical Hacking Career
If you want to learn hacking skills, practise on your own lab systems, intentionally vulnerable applications, capture-the-flag competitions and legal training platforms. Certifications such as CEH or OSCP are valuable for employability, but they do not grant permission to test anyone’s systems.
Get written permission before testing
Ethical hacking is a respected and legal profession when it is authorised, scoped and conducted responsibly. Good intentions alone are not a defence. Researchers who work through contracts, bug bounty programmes and safe harbour policies can help organisations stay secure while protecting themselves from legal risk.
Frequently Asked Questions
Can I legally scan a website for vulnerabilities?
Only if you own it or have permission from the owner, for example through a bug bounty programme that lists it in scope.
Is it legal to report a vulnerability I found by accident?
Reporting is generally encouraged, but how you found and verified the issue matters. Stop as soon as you notice the problem and report through official channels.
Does a bug bounty programme protect me from prosecution?
It authorises testing that follows its rules, which greatly reduces risk, but it cannot bind prosecutors or protect conduct outside its scope.