Skip to content
← Back to the module
Lesson 0211 min read

Ethics, Scope and Responsible Disclosure

The legal and ethical rules every security tester follows, from authorisation and scope to responsible disclosure and safe harbour.

The one rule that matters most

Never test a system without permission from its owner. Everything else in this lesson is a refinement of that sentence.

Good intentions do not make unauthorised access legal. "I only wanted to help", "the site was already insecure" and "I did not change anything" are not legal defences in most countries. Security researchers have received legal threats, lost jobs and in some cases been prosecuted for well-meant testing. This is the profession's biggest practical risk, and it is entirely avoidable.

Throughout HuntingBugs, every technique you learn is for use on the labs provided here, on your own systems, or on targets where you hold explicit, written authorisation.

Why the law cares

Most countries criminalise accessing a computer system without authorisation, or exceeding the authorisation you were given. Names and details vary, so you must check the rules where you live and where the target is hosted. A few well-known examples:

  • United States: the Computer Fraud and Abuse Act (CFAA). In May 2022 the Department of Justice announced a policy that good-faith security research should not be charged under the CFAA, but this is a prosecutorial policy, not immunity, and it does not stop civil lawsuits.
  • United Kingdom: the Computer Misuse Act 1990.
  • European Union: the Directive on attacks against information systems (2013/40/EU), implemented in each member state's criminal law. In Spain, unauthorised access to systems is covered by the Código Penal (article 197 bis and related articles).
  • Other laws also matter: data protection and privacy laws (such as GDPR) apply if you touch personal data, and terms of service and contracts can create civil liability.

Laws also differ about what counts as "access". Reading an ID in a URL and changing it to a different number is, in many courts' eyes, access beyond what the owner intended, even though a browser would have happily done it. Do not rely on your own interpretation of the law. Rely on written permission.

What counts as authorisation

Authorisation should be:

  • Explicit: a contract, statement of work, engagement letter or a bug bounty programme's published policy. A verbal "go ahead" is not enough for professional work.
  • From someone entitled to give it: the system owner. You cannot authorise testing of a third party's infrastructure (for example a cloud provider or SaaS vendor) on their behalf. Providers often publish their own rules for customer testing.
  • Specific: it names targets, time windows and permitted techniques.
  • Recorded: keep a copy. In a dispute, "I was allowed" needs a document behind it.

Scope: the boundary of your permission

Scope is the precise definition of what you may test. Bug bounty programmes and pentest contracts both define it, and it is binding.

A typical scope has these parts:

Part Typical content
In-scope assets Domains, wildcard subdomains, IP ranges, mobile apps, APIs
Out-of-scope assets Third-party services, corporate mail, legacy hosts, partner sites
Permitted techniques Manual testing, light automated scanning, authenticated testing with your own accounts
Prohibited techniques Denial of service, social engineering, physical access, spam, destructive actions
Rules of engagement Test windows, rate limits, required headers or user-agent, point of contact
Data handling What you may access, what you must not store, how to report secrets you find
Reward and safe-harbour terms What is paid, what is considered a duplicate, what legal protection is offered

Common scope mistakes

  • Assuming a related asset is in scope. app.example.com being in scope does not mean example.org, a vendor's login page, or a SaaS tool the company uses is.
  • Following a redirect or a link out of scope. If a request ends up on a third party's server, stop. You are no longer testing your target.
  • Treating wildcard scope as unlimited. *.example.com covers subdomains, but a subdomain that is actually hosted and operated by a third party may still be excluded; read the policy.
  • Running aggressive scanners at full speed. An automated tool can crash a fragile service and turn a legitimate test into an outage.
  • Using stolen or leaked credentials. Even when you find valid credentials in a leak, logging in with them is generally beyond a researcher's authorisation. Report the leak instead.

Before testing any asset, ask: "Is this exact hostname or IP explicitly listed as in scope?" If the answer is not a clear yes, do not touch it. Ask the programme or client.

Principles of ethical testing

Minimise harm

  • Prefer the least invasive test that proves the bug. For an injection, retrieving the database version or a harmless marker is proof; dumping a customer table is not necessary and may be unlawful.
  • Do not degrade availability. Throttle automated tools, avoid heavy payloads, never run load tests unless authorised.
  • Do not modify or delete data you do not own. If you must create data to prove a bug, create it in your own test account and clean it up.

Respect data and privacy

  • Use accounts you created for access-control testing. If you must prove cross-account access, use two of your own accounts.
  • If you accidentally see another person's personal data, stop, record the minimum needed (for example that the endpoint returned another user's record, with the sensitive values redacted) and report it. Do not download, keep, share or use it.
  • Never pivot into internal systems beyond what the programme explicitly allows. Finding a vulnerability that gives internal access is a reason to report, not to explore.

Be honest and professional

  • Report accurately, without exaggeration or threats. Never demand payment as a condition of disclosure; that is extortion.
  • Do not publish a finding to pressure a vendor unless a disclosure policy gives you that right and the timeline has passed.
  • Credit others' work and do not claim findings that are not yours.

Know when to stop

Stop as soon as you have a minimal proof of impact. Escalation beyond that adds legal risk and rarely adds value. A reflected XSS proof of concept can call alert(document.domain); it does not need to steal real users' sessions. An IDOR needs one record of your own second account, not thousands.

Responsible (coordinated) disclosure

Disclosure is how a private finding becomes a fixed bug. The terms vary:

  • Responsible / coordinated disclosure: you report privately, the vendor fixes the issue, and details become public after the fix or after an agreed deadline.
  • Full disclosure: details are published immediately. This is controversial and often riskier for you.
  • Non-disclosure: you never speak publicly, sometimes imposed by a contract or bounty programme.

How to report

  1. Find the right channel. Check the bug bounty programme page, or the file /.well-known/security.txt on the site. That file is standardised by RFC 9116 and lists a security contact, preferred languages, a policy URL and sometimes an encryption key:

    Contact: mailto:[email protected]
    Expires: 2027-12-31T23:59:59.000Z
    Encryption: https://example.com/pgp-key.txt
    Policy: https://example.com/security-policy
    Preferred-Languages: en, es
    
  2. Report privately. Do not post on social media or in public issue trackers. Encrypt sensitive details if a key is provided.

  3. Write a clear report. Include a summary, the affected URL or component, reproduction steps, the impact (what an attacker could do), evidence (redacted requests and responses) and a suggested fix.

  4. Give the vendor time. Common deadlines in the industry range from 45 to 90 days, depending on severity and the vendor's responsiveness. Google Project Zero's well-known policy uses a 90-day deadline; many bounty platforms have their own disclosure rules, which you must follow.

  5. Stay in contact. Answer questions, retest the fix and agree before publishing anything.

The international standards ISO/IEC 29147 (vulnerability disclosure) and ISO/IEC 30111 (vulnerability handling) describe how organisations should receive and process reports. A mature vendor follows them.

What a good report looks like

Title: Missing authorization check on /api/orders/{id} allows reading other users' orders

Summary:
Any authenticated user can read any other user's order by changing the numeric id.

Steps to reproduce:
1. Log in as test user A and note your order id 1042.
2. Send GET /api/orders/1043 with A's session. (1043 belongs to my second test account B.)
3. The response contains B's name, address and items.

Impact:
Disclosure of personal data of every customer; ids are sequential so enumeration is trivial.

Suggested fix:
Check that order.owner_id equals the authenticated user's id before returning the resource.

Short, reproducible, no customer data beyond what proves the point.

Bug bounty programmes and safe harbour

A bug bounty programme is a standing invitation to test in return for recognition or payment. Platforms such as HackerOne and Bugcrowd host many programmes, and companies also run their own. A vulnerability disclosure programme (VDP) is similar but usually unpaid.

Safe harbour is the promise a programme makes that it will not pursue legal action against researchers who follow its rules. A strong safe-harbour statement says that testing within scope is authorised, that the organisation will not bring legal claims and will tell third parties that your testing was authorised. The disclose.io project publishes standard safe-harbour language that many programmes adopt.

Important caveats:

  • Safe harbour only covers what the policy covers. Out-of-scope testing and prohibited techniques void it.
  • A company's promise does not bind third parties (hosting providers, other companies' data) or prosecutors in every jurisdiction.
  • Programmes that lack safe-harbour language carry higher risk. Read the terms and, if unsure, ask before testing.

Treat the programme policy like a contract. Read it fully every time you start on a target, because policies change.

Professional engagements

Paid penetration tests add formal documents:

  • Statement of work / contract: services, price, deliverables.
  • Rules of engagement (RoE): scope, schedule, permitted techniques, escalation contacts, emergency stop procedures.
  • Authorisation letter ("get out of jail free" letter): signed by someone with authority, listing the tester's name and the targets, useful if your traffic triggers an incident response.
  • Confidentiality / NDA: you must protect everything you learn.
  • Data handling: how to store, encrypt and delete evidence after the engagement.

Testers also commonly carry professional liability insurance, and test hosted assets only after confirming the hosting provider's policy.

On HuntingBugs

  • Lab instances are private, isolated and expire automatically. Attack them freely.
  • The platform itself (other users, the dashboard, billing, the infrastructure that runs the labs) is out of scope and against the terms of service. Do not attempt to break out of a lab container or attack the host.
  • If you find a real vulnerability in the platform, report it to the team privately.
  • Do not use techniques you learn here against real sites "just to check".

Checklist before any test

  • I have written authorisation (or I am in an isolated lab).
  • I have read the scope and this exact asset is in it.
  • I know which techniques are prohibited and the rate limits.
  • I will use only accounts I created.
  • I know who to contact and how to report privately.
  • I will stop at minimal proof of impact and store no real user data.

Key takeaways

  • Authorisation is mandatory, specific, explicit and recorded. Intent is not a defence.
  • Scope is binding: if it is not clearly listed, do not test it.
  • Cause the least harm possible; stop at minimal proof.
  • Report privately, clearly and with a fix suggestion; allow reasonable time before any publication.
  • Safe harbour helps, but only inside the written policy.

Further reading