Web & Application Security

Chapter 10
Application Security Testing and Ethical Assessment

Advance Diploma in Cybersecurity
Web & Application Security   •   Advance Diploma

Application Security Testing and Ethical Assessment

Introduction and Context

Application security testing is the systematic examination of software, interfaces, configurations, and supporting services to identify, validate, communicate, and help remediate security weaknesses. It is broader than “finding vulnerabilities.” A professional assessment must establish scope, collect reliable evidence, distinguish exploitable conditions from theoretical concerns, demonstrate impact without unnecessary harm, and produce findings that another qualified practitioner can reproduce.

Testing is performed throughout the software development life cycle. Requirements review and threat modelling help prevent defects; secure code review and static analysis examine implementation; dynamic testing examines running systems; penetration testing evaluates realistic attack paths; and retesting determines whether remediation is effective. No single technique provides complete assurance because each observes different aspects of risk.

This chapter focuses on authorised reconnaissance, vulnerability assessment, penetration testing, evidence preservation, safe validation, and reproducible reporting. It assumes that all activity is conducted within written permission and an agreed rules-of-engagement document.

Learning Objectives

By the end of this chapter, a learner should be able to:

  1. Explain the purpose, scope, and limitations of application security testing.
  2. Plan an authorised assessment using scope, rules of engagement, risk controls, and communication procedures.
  3. Conduct passive and active reconnaissance using manual and automated methods without exceeding authorisation.
  4. Assess web applications, APIs, mobile back ends, dependencies, and configurations using complementary techniques.
  5. Validate findings safely, preserve evidence, and distinguish false positives from confirmed vulnerabilities.
  6. Prioritise findings using likelihood, impact, exploitability, and business context.
  7. Produce clear, reproducible technical and executive reports.
  8. Evaluate ethical, legal, privacy, and governance obligations in professional testing.

1. The Assurance Problem

Security testing addresses three related questions:

  • What is exposed? Assets, endpoints, identities, data stores, dependencies, and trust relationships must be identified.
  • What can go wrong? Weaknesses must be related to realistic threats and business consequences.
  • What should be done? Findings must lead to proportionate, verifiable risk reduction.

Testing is not the same as vulnerability scanning. A scanner may identify a suspected outdated component or an unusual response, but it generally cannot understand business logic, determine whether sensitive data is actually reachable, or decide whether a reported issue is exploitable in the deployment context. Human analysis supplies context and validation.

A useful assurance model combines four dimensions:

DimensionCentral questionTypical evidence
CoverageWhich assets and behaviours were examined?Scope inventory, endpoint list, test matrix
ValidityIs the suspected weakness real?Reproduction steps, requests, responses, screenshots
ImpactWhat could an attacker or unauthorised user achieve?Data classification, privilege analysis, controlled proof
ReproducibilityCan another tester repeat the result?Preconditions, tool versions, timestamps, sanitised artefacts

Important distinctions

Vulnerability assessment is the structured identification and prioritisation of weaknesses. Penetration testing goes further by attempting controlled exploitation to determine whether weaknesses can be chained and what impact is achievable. Red teaming is a broader, objective-driven simulation that may include people, processes, physical controls, and technology. Security testing is the umbrella term covering these and other activities.

A test can be technically sophisticated yet professionally poor if it lacks permission, damages data, exposes personal information, or reports unverifiable claims.

2. Governance Before Technical Activity

Authorisation and scope

Written authorisation should identify:

  • the legal entity granting permission;
  • the systems, domains, applications, APIs, mobile packages, cloud accounts, and IP ranges in scope;
  • excluded systems and prohibited actions;
  • testing dates, time zones, and maintenance windows;
  • approved source addresses and tester identities;
  • permitted test intensity and rate limits;
  • handling and retention of sensitive evidence;
  • emergency contacts and stop conditions;
  • reporting recipients and disclosure restrictions.

A tester must not infer permission from public accessibility. A publicly reachable system is not automatically a permitted target. Third-party services, payment providers, customer environments, and hosted platforms require explicit coordination.

Rules of engagement

The rules of engagement translate authorisation into operational constraints. They should state whether authenticated testing is permitted, which test accounts may be used, whether social engineering is excluded, and whether destructive actions such as deletion, denial of service, persistence, or real-world transaction completion are prohibited. Where a test could affect availability, the safest default is to use a staging environment or a controlled test object.

A stop condition might be triggered by evidence of production data modification, unexpected service degradation, access to highly sensitive records, or an apparent compromise outside scope. The tester should stop, preserve minimal evidence, notify the agreed contact, and await direction.

Ethical principles

Professional assessment is governed by legality, competence, proportionality, confidentiality, integrity, and accountability. The least-invasive technique that answers the assessment question should be preferred. Testers should avoid collecting unnecessary personal data, redact secrets from reports, encrypt evidence, restrict access, and securely destroy material according to the agreed retention schedule.

3. Planning the Assessment

A practical plan links objectives to test activities and evidence. For example, the objective “determine whether an ordinary customer can access another customer’s invoice” leads to an identity and authorisation test, controlled test accounts, a harmless pair of records, and evidence showing subject and object identities.

Scope and asset modelling

Construct an asset inventory from authoritative sources such as architecture diagrams, deployment manifests, DNS records supplied by the owner, API specifications, and application documentation. Record ownership, environment, data sensitivity, authentication method, and dependencies. Treat scope as a living set: new hosts or endpoints discovered during testing require confirmation before active testing.

Threat-informed prioritisation

Threat modelling helps select tests rather than blindly running every tool. A simple approach is to identify:

  1. assets and business processes;
  2. trust boundaries;
  3. actors and entry points;
  4. security properties at risk—confidentiality, integrity, availability, authenticity, and accountability;
  5. plausible abuse cases and controls.

For web applications, common trust boundaries occur between browsers and servers, tenants, services, APIs, queues, databases, identity providers, and third-party integrations.

Test matrix

A test matrix prevents important areas from being overlooked.

AreaManual focusAutomated supportEvidence
Authenticationaccount recovery, MFA, session transitionsendpoint discovery and response analysistest-account traces
Authorisationhorizontal and vertical access controlparameter and role comparisonpaired requests and responses
Input handlingcontext-specific injection and validationpassive/active scanners in safe modesanitised payload and result
Session managementexpiry, rotation, revocation, cookie flagsproxy checkscookie attributes and timestamps
Configurationheaders, TLS, error handling, exposed filesconfiguration scannersrelevant response or configuration
Dependenciesversions, reachability, exploitabilitysoftware composition analysisdependency and advisory evidence
Business logicworkflow abuse, race conditions, transaction limitslimited scripted checkscontrolled workflow record

4. Reconnaissance: Knowing the Authorised Attack Surface

Reconnaissance is the collection and interpretation of information about an authorised target. Passive reconnaissance uses information already available without directly interacting with the target beyond ordinary access, such as supplied documentation, public registration records, published API specifications, and search-engine results. Active reconnaissance sends direct requests or probes to identify services, routes, technologies, and behaviours.

A disciplined workflow

  1. Confirm the target against the signed scope.
  2. Establish a baseline using ordinary, low-rate requests.
  3. Identify hosts, applications, API versions, authentication boundaries, and content paths.
  4. Record observations with timestamps and source attribution.
  5. Remove duplicates and classify assets by confidence.
  6. Obtain approval before extending the scope or increasing intensity.

Reconnaissance should be hypothesis-driven. If the objective concerns tenant isolation, discovering every historical file is less useful than mapping identity, tenant identifiers, object references, and authorisation decisions.

Manual and automated methods

Manual browsing reveals workflows, state transitions, client-side assumptions, and error messages that automated tools may miss. An intercepting proxy can record requests made by a test account, but captures should be filtered and sanitised. Automated crawlers and endpoint discovery tools improve coverage, particularly for large applications, but can trigger state changes, follow untrusted links, or create excessive load. Configure them with authentication boundaries, rate limits, exclusions, and safe methods where possible.

Reconnaissance outputs should include an asset register, endpoint catalogue, technology observations, authentication map, and assumptions requiring confirmation. Technology fingerprints are hypotheses, not proof; a response header or JavaScript library name can be misleading because proxies, CDNs, and custom builds may alter the observable result.

5. Vulnerability Assessment Methods

Static application security testing

Static application security testing (SAST) examines source code, bytecode, or intermediate representations without executing the application. It can identify unsafe data flows, weak cryptographic use, insecure deserialisation patterns, and missing validation early in development. Its limitations include framework complexity, configuration dependence, false positives, and difficulty understanding runtime authorisation.

Dynamic application security testing

Dynamic application security testing (DAST) examines a running application from an external perspective. It can observe headers, responses, error handling, authentication behaviour, and input processing. DAST may miss unlinked routes, authenticated functions, race conditions, and logic flaws unless supplied with appropriate workflows and accounts.

Interactive and runtime analysis

Interactive application security testing (IAST) combines runtime observation with instrumentation, linking an input to a code path or sink. Runtime application self-protection (RASP) attempts to detect or block attacks during operation. These approaches can add useful context but require careful deployment, performance evaluation, and privacy governance.

Software composition analysis

Software composition analysis identifies third-party libraries, versions, licences, and known advisories. A vulnerable version is not automatically an exploitable application vulnerability: the affected function may be unreachable, disabled, patched by a vendor, or shielded by configuration. Conversely, a component with no public advisory may still be unsafe in the application’s use context.

Manual testing

Manual testing is essential for:

  • broken object-level authorisation;
  • role and tenant separation;
  • workflow and transaction abuse;
  • insecure direct object references;
  • password reset and account recovery;
  • state-machine inconsistencies;
  • chained vulnerabilities;
  • privacy and business-impact interpretation.

A strong assessment uses automation for scale and manual reasoning for meaning.

6. Safe Validation and Impact Demonstration

Validation asks whether a suspected weakness is genuine, reproducible, and relevant. It should not become an uncontrolled attack. The preferred evidence hierarchy is:

  1. a harmless observation showing the security control is absent;
  2. access to a tester-owned object or synthetic record;
  3. a minimal proof using a canary value;
  4. a controlled demonstration in a replica or staging environment;
  5. a higher-impact action only with explicit approval and safeguards.

For example, to test authorisation, create two synthetic accounts and two non-sensitive records. Authenticate as Account A, request Account B’s record identifier, and observe whether the server enforces ownership. Do not use another customer’s real record merely because it is accessible.

Evidence quality

Evidence should establish context, action, and result. Useful fields include:

  • finding identifier;
  • tester and test account;
  • target and environment;
  • date and time with time zone;
  • request method, path, relevant headers, and sanitised body;
  • response status, selected headers, and sanitised body;
  • preconditions and sequence;
  • expected versus actual behaviour;
  • impact and scope;
  • tool name and version where relevant;
  • cryptographic hash of the stored artefact.

A cryptographic hash is an integrity check, not proof that the content is truthful. For a file, a digest such as SHA-256 can demonstrate that the preserved file has not changed since hashing. Hashes do not provide confidentiality; evidence still requires access control and encryption.

False positives and false negatives

A false positive is a reported issue that is not actually present or exploitable. A false negative is a missed issue. Reduce false positives by reproducing with an independent method, checking deployment version and configuration, and confirming the affected component is reachable. Reduce false negatives through multiple test techniques, authenticated coverage, workflow analysis, and review of exclusions.

7. Risk Analysis and Prioritisation

Severity should reflect both technical properties and business context. A useful qualitative model considers:

  • impact on confidentiality, integrity, and availability;
  • privileges required;
  • attack complexity;
  • user interaction;
  • exposure and discoverability;
  • affected asset value;
  • detectability and existing controls;
  • regulatory or contractual consequences.

Where an organisation uses the Common Vulnerability Scoring System (CVSS), the published version and vector should be recorded rather than an unexplained score. CVSS is a standardised technical severity method; it is not a complete business-risk calculation. A critical technical issue on an isolated test host may receive lower treatment than a moderate flaw exposing regulated production data.

Avoid false precision. If likelihood data are not defensible, use ordered categories such as low, medium, high, and critical with explicit rationale. Risk acceptance must be made by an accountable system owner, not silently by the tester.

8. Reporting for Reproducibility

A professional report serves both decision-makers and engineers. It normally contains:

  1. Executive summary: objectives, scope, dates, overall conclusions, and major risks.
  2. Methodology: standards or internal procedures, tools, account types, and limitations.
  3. Scope and exclusions: exact assets, environments, and untested areas.
  4. Findings register: identifiers, titles, severity, affected assets, status, and owners.
  5. Technical findings: description, prerequisites, reproduction steps, evidence, impact, and remediation.
  6. Risk treatment: recommended priority, compensating controls, and residual risk.
  7. Retest results: fixed, partially fixed, not fixed, or unable to verify.
  8. Appendices: sanitised logs, test matrix, and evidence index.

A finding title should describe the weakness and affected component, for example, “Missing server-side tenant authorisation on invoice retrieval.” The description should explain the violated security property, not merely state that a scanner issued an alert.

Reproduction standard

Another qualified tester should be able to reproduce the finding using the report alone, subject to authorised credentials and environmental prerequisites. Steps should identify the starting state, exact role, request sequence, expected control, observed result, and safe cleanup. Dynamic values such as tokens, personal data, and secrets must be replaced with placeholders.

Remediation quality

Recommendations should address the root cause. “Validate input” is weak unless the report identifies the correct context, server-side enforcement, canonicalisation, and appropriate allow-list or encoding strategy. For authorisation failures, recommend centralised server-side policy enforcement, object ownership checks, deny-by-default behaviour, and tests for each role and tenant boundary. Retesting should verify both the original path and nearby variants.

9. Applied Case: Illustrative Multi-Tenant Invoice Portal

This is a fictional instructional case. No real system or organisation is involved.

Background

A company commissions an authorised assessment of a cloud-hosted invoice portal. The scope includes the production application’s test tenant, two synthetic customer accounts, the documented API, and a staging environment. Destructive actions, real customer data, and payment completion are excluded.

Problem

The business wants assurance that a customer cannot view or alter another customer’s invoices. Automated scanning reports no injection vulnerabilities, but the application contains many object identifiers in API requests.

Analysis

The testers create Customer A and Customer B, each with synthetic invoices. They map the normal workflow: login, list invoices, open an invoice, download a PDF, and request a correction. The test matrix compares requests from both accounts. The server correctly restricts the invoice list but fails to enforce ownership on one invoice-detail route. A request made with Customer A’s session and Customer B’s synthetic identifier returns the invoice metadata and PDF.

The testers stop before testing modification because read access already demonstrates a confidentiality failure and the rules prohibit unnecessary changes. They preserve a sanitised request and response, record the account and object relationship, and notify the client contact according to the escalation procedure.

Approach and solution

The report classifies the issue as a broken object-level authorisation flaw. It recommends server-side ownership checks on every operation, a policy decision point shared by API routes, opaque identifiers as a defence-in-depth measure rather than the primary control, and automated tests covering cross-tenant read, download, update, and delete attempts. The client deploys the fix to staging. Retesting confirms that Customer A receives a denial response for Customer B’s invoice while retaining access to its own invoice.

Outcome and learning points

The case demonstrates why scanner output cannot substitute for workflow analysis. It also illustrates safe impact validation: synthetic records, minimal access, no modification, evidence preservation, and an independent retest. Most importantly, authorisation must be enforced on the server for every object and action; hiding identifiers or relying on the user interface is insufficient.

10. Tool Use, Automation, and AI

Tools should support professional judgement rather than replace it. A controlled toolkit may include an intercepting proxy, crawler, HTTP client, source analyser, dependency analyser, template-based scanner, configuration checker, and evidence-management system. Tool output should be versioned, time-stamped, reviewed, and correlated with the target environment.

Automation introduces risks: excessive request volume, state-changing actions, inaccurate authentication handling, exposed credentials in logs, and unreviewed scanner claims. Use dedicated accounts, secrets management, rate limits, allow-lists, safe scan modes, and output review.

AI-assisted tools can help summarise logs, suggest test cases, identify similar code patterns, or draft remediation language. They may hallucinate vulnerabilities, omit environmental assumptions, reproduce secrets in prompts, or generate unsafe test actions. Do not submit confidential source code, credentials, personal data, or proprietary evidence to an unapproved service. Human review remains responsible for scope, interpretation, safety, and final reporting.

11. Legal, Privacy, and Regulatory Considerations

Unauthorised access, excessive interference, interception, or handling of personal data may breach criminal, civil, contractual, or data-protection obligations. Applicable requirements vary by jurisdiction and sector. A tester should obtain legal and privacy guidance where scope crosses borders, involves regulated data, or includes third-party infrastructure.

Data minimisation is central: use synthetic accounts, collect only what is needed, redact identifiers, encrypt evidence in transit and at rest, limit access by role, log evidence access, and delete material on schedule. Findings should be disclosed only to authorised recipients. If a previously unknown severe exposure is found, follow the agreed incident and escalation process rather than independently contacting affected individuals or publishing details.

12. Limitations and Contemporary Practice

No assessment proves that an application is secure. Testing is bounded by time, scope, credentials, environment differences, unavailable source code, rate limits, and unknown business workflows. Production testing may understate risk because destructive actions are prohibited; staging may overstate or understate risk because configuration and data differ.

Modern applications require attention to APIs, single-page applications, serverless functions, containers, software supply chains, identity federation, cloud permissions, event-driven workflows, and machine-learning interfaces. Continuous testing integrates security checks into development and deployment pipelines, but speed must not eliminate human review of high-risk changes. Security regression tests should be retained for confirmed findings so that fixes do not silently fail in later releases.

Best-Practice Checklist

Before testing, confirm written authorisation, scope, contacts, test accounts, exclusions, safety controls, and evidence handling. During testing, maintain a timestamped activity log, use the least-invasive method, respect rate limits, separate observation from inference, and escalate unexpected impact. After testing, validate each finding, redact sensitive material, hash and protect evidence, communicate urgent issues promptly, obtain remediation ownership, and perform a documented retest.

Chapter Summary

Application security testing is an authorised, evidence-based process rather than a search for impressive exploits. Effective assessment combines planning, threat-informed reconnaissance, automated coverage, manual workflow analysis, safe validation, risk contextualisation, and reproducible reporting. Written permission and rules of engagement define lawful and safe boundaries. Static, dynamic, interactive, dependency, configuration, and manual methods reveal different classes of weakness and must be interpreted together. Findings should be demonstrated with synthetic or tester-owned data whenever possible, while evidence is minimised, protected, and preserved for verification. Technical severity must be distinguished from business risk, and remediation must be retested. Automation and AI can improve scale and productivity, but neither replaces professional judgement, ethical responsibility, or human accountability.

Key Terms

Authorisation: Written permission to perform specified security activities against defined targets.

Attack surface: The set of reachable assets, interfaces, functions, and trust boundaries that may be exposed to threats.

Broken object-level authorisation: Failure to verify whether a requester may access a particular object.

DAST: Dynamic application security testing performed against a running application.

Evidence: Preserved information supporting an assessment observation or finding.

False negative: A real weakness that testing fails to identify.

False positive: A reported weakness that is not actually present or exploitable.

IAST: Interactive application security testing using runtime observation and instrumentation.

Penetration testing: Controlled attempts to exploit weaknesses to evaluate realistic impact.

Reconnaissance: Collection and analysis of information about an authorised target.

Retest: A later assessment to verify whether remediation is effective.

Rules of engagement: Operational constraints governing an authorised test.

SAST: Static application security testing of source, bytecode, or intermediate code.

Scope: The explicitly authorised systems, environments, dates, and activities.

Threat modelling: Structured analysis of assets, trust boundaries, actors, threats, and controls.

Vulnerability assessment: Identification, analysis, and prioritisation of security weaknesses.

Vulnerability: A condition that can violate a security property when combined with a threat or action.

Review Questions

Short Answer Questions

  1. Why is written authorisation necessary even when an application is publicly accessible?
  2. Distinguish vulnerability assessment from penetration testing.
  3. What information should a reproducible finding contain?
  4. Why should synthetic records be preferred during impact validation?
  5. State two limitations of automated vulnerability scanners.

Long Answer Questions

  1. Explain how rules of engagement reduce legal, operational, and ethical risk during an assessment.
  2. Compare SAST, DAST, IAST, software composition analysis, and manual testing.
  3. Describe a complete workflow for testing authorisation in a multi-tenant web application.
  4. Explain how evidence should be collected, sanitised, protected, and used in a technical report.
  5. Discuss why technical severity and business risk should not be treated as identical concepts.

Analytical / Application Questions

  1. You discover that a test account can read a second synthetic tenant’s invoice but cannot modify it. Design a safe validation plan and identify the evidence required.
  2. A scanner reports a critical vulnerable library, but the affected function is disabled and unreachable. Analyse what must be verified before assigning final severity.
  3. During an authorised production test, a request unexpectedly returns highly sensitive personal data. Explain the immediate actions, communication, evidence, and follow-up decisions you would make.

Multiple Choice Questions with Answers

Question 1

Which activity most clearly distinguishes penetration testing from a basic vulnerability assessment?

A. Creating an asset inventory

B. Attempting controlled exploitation to determine realistic impact

C. Reviewing the application’s privacy notice

D. Listing software versions

Correct Answer: B. Attempting controlled exploitation to determine realistic impact

Question 2

What is the safest evidence for demonstrating an authorisation flaw?

A. A real customer’s complete medical record

B. A destructive database modification

C. Access to a tester-owned synthetic record

D. An unverified scanner alert

Correct Answer: C. Access to a tester-owned synthetic record

Question 3

Which document defines permitted targets, prohibited actions, dates, and emergency contacts?

A. Rules of engagement

B. Source-code licence

C. Asset depreciation schedule

D. Marketing plan

Correct Answer: A. Rules of engagement

Question 4

What is a principal limitation of automated scanning?

A. It cannot send any HTTP requests

B. It always requires source code

C. It cannot reliably understand business logic and context

D. It produces no output for authenticated applications

Correct Answer: C. It cannot reliably understand business logic and context

Question 5

Which control is primarily intended to prevent one tenant from accessing another tenant’s object?

A. Client-side hiding of an identifier

B. Server-side ownership and authorisation checking

C. Increasing image resolution

D. Changing the page colour

Correct Answer: B. Server-side ownership and authorisation checking

Question 6

What does a cryptographic hash of an evidence file primarily provide?

A. Confidentiality

B. Availability

C. Integrity verification

D. Legal permission

Correct Answer: C. Integrity verification

Question 7

Which statement about a vulnerable third-party library is most accurate?

A. A vulnerable version always proves exploitable impact

B. The library can be ignored if it is open source

C. Reachability, configuration, use, and compensating controls must be assessed

D. Only the library author can determine application risk

Correct Answer: C. Reachability, configuration, use, and compensating controls must be assessed

Question 8

Which report characteristic allows another qualified tester to repeat a finding?

A. A severity label without technical detail

B. Exact preconditions, sequence, requests, results, and environment assumptions

C. A screenshot with no timestamp

D. A list of tool names only

Correct Answer: B. Exact preconditions, sequence, requests, results, and environment assumptions

Question 9

What is the appropriate response when testing unexpectedly exposes highly sensitive production data?

A. Download all records for completeness

B. Publish the data to prove impact

C. Stop or minimise the activity, preserve limited evidence, and notify the agreed contact

D. Continue testing until the system fails

Correct Answer: C. Stop or minimise the activity, preserve limited evidence, and notify the agreed contact

Question 10

Which statement best describes the role of AI in security testing?

A. AI output is automatically a confirmed vulnerability

B. AI removes the need for authorisation

C. AI can assist analysis, but human review remains responsible for safety and accuracy

D. AI tools may freely receive credentials if testing is authorised

Correct Answer: C. AI can assist analysis, but human review remains responsible for safety and accuracy

Web & Application Security
Chapter 10 of 14