Skip to main content
Hamza Khan

Last updated

Secure-by-design legal infrastructure

Security testing for applications, AI and workflows

I test the infrastructure legal work depends on, including web apps, APIs, AI/LLM features, workflows and integrations. The assessment looks for weaknesses that put data or actions at risk. I combine OWASP-informed checks and manual penetration testing to validate access-control failures, prompt injection and unintended actions, then explain the impact and practical fixes.

Active testing requires your authorization and an agreed scope. Remediation and retesting are included only where agreed.

  • Web apps, APIs and AI/LLM features
  • Workflows and integrations
  • OWASP-informed manual testing
  • Validated findings and practical fixes
  • Retesting, when included
  • Testing only after authorization

The assessment replay, walkthrough and examples use a fictional application and findings. Client assessments stay under NDA.

Fictional assessment replay

Example · Customer document accessIllustrative

Can one customer read another customer’s file?

  1. Customer A

    Asks for a file

  2. App permissions

    Ownership checked

  3. Customer B's file

    Access blocked

Repeat the same request

In the corrected example, the same request is refused. The other customer's file stays private.

Technical details

Test environment · Two demo roles

Repeat the original request: HTTP 403, no document returned. Record the retest result and any remaining scope limits.

Report: agreed scope, reproduction evidence, impact, remediation and retest results when included.

Illustrative assessment · fictional application and finding · not a client result. Testing and retesting require an agreed scope.

Example report structure — not client findings

What you receive

Every report answers five questions, from the agreed scope to retesting when included.

  1. Part 01

    What was tested?

    Scope record

    The application areas, roles and conditions actually assessed.

  2. Part 02

    What is real?

    Validated findings

    Affected behavior, reproducible steps and relevant evidence, with sensitive material handled appropriately.

  3. Part 03

    Why does it matter?

    Impact and priority

    What the weakness enables and why it matters in this system.

  4. Part 04

    How do we fix it?

    Remediation guidance

    Practical changes for the relevant application layer.

  5. Part 05

    Did the fix work?

    Retest results

    Resolved, partially resolved or still reproducible, with any remaining limits.

    When included

Start here · No technical background needed

How an assessment works, in four steps

An assessment answers a specific question about your application, within limits agreed in advance.

  1. 01

    Agree what to test

    We agree the application, the workflow, the user roles and the question to answer, and confirm that testing is authorized.

  2. 02

    Test it

    I examine the agreed workflow by hand, with tools in support, looking for ways around its rules and protections.

  3. 03

    Confirm what is real

    Relevant possible issues are examined by hand to confirm whether they are real and what they allow.

    Manual validation

  4. 04

    Report, fix and check again

    You receive a report with the findings and recommended fixes. Your team makes the fixes, or I do when implementation is within the agreed scope. When retesting is included, I check the changed behavior.

Think of it as a commissioned inspection of agreed rooms in a building. The inspector tries the doors the way different people would, records which ones open when they should not, recommends repairs and, if agreed, comes back to check them. The report covers the rooms inspected, not the whole building, and it is not a certificate.

Why it matters

What an assessment helps you understand

Tools point to possible issues. An assessment confirms which ones are real in your system, what they allow and how to fix them.

The challenge

  • It is hard to know whether users, roles and customer accounts can reach records or functions beyond their permissions.
  • Login, recovery and sensitive account changes need checking for ways they could be misused (abuse paths), not only their normal use.
  • AI features that read untrusted content need checking for whether that content can redirect them.
  • Tools point to possible issues; someone still has to confirm whether the relevant ones are real, exploitable and important in your system.

What an assessment provides

  • A defined scope: the application areas, roles and conditions actually assessed.
  • Validated findings with reproducible steps, relevant evidence and an explanation of impact.
  • Practical remediation guidance for the relevant application layer.
  • Retesting of the changed behavior, when included, and implementation of fixes when it is within the agreed scope and access.

Example questions

Three questions an assessment can answer

These are assessment questions, not findings about your product.

  • Question 1

    Can a user reach another customer’s records or restricted functions by making requests directly?

    • Access control and tenant isolation
  • Question 2

    Can an application action happen without the required state, permission or approval?

    • Business logic
  • Question 3

    Can untrusted content redirect an AI feature beyond its intended task or permitted information?

    • AI and LLM features

Interactive walkthrough · Fictional example

Follow one assessment from scope to retest

Step through a fictional assessment of a made-up application to see what happens at each stage. Each step has a plain-language explanation and a technical note.

Step 1 of 5

Agree what to test and why

We choose the part of the application to examine and the question it should answer. In this fictional example: can a member of one customer account reach another customer’s documents by sending requests directly?

Under the hood

Define the target and objective: the relevant application, workflow, roles and assessment question. Here the coverage is access control and tenant isolation, including object-level and function-level authorization and direct API access.

  • Scope
  • Roles
  • Tenant isolation
  • Object-level authorization
Scope record · Demo AppIllustrative

Target

Application
Demo App web application and API
Workflow
Shared documents
Roles
Admin (demo), Member (demo)
Customer accounts
Tenant A, Tenant B (test data)

Assessment question

Can a Member in Tenant A reach Tenant B’s documents by direct request?

Not in scope

  • Production environment
  • AI feature (demo)

Step 1 of 5: Agree what to test and why

Every screen in this walkthrough is an illustration made for this page, with a fictional application and fictional findings. None is a product screenshot or a client finding.

First step

Free product & security review

Bring one product workflow or AI feature. I review its architecture, permissions and failure points and send a brief record of what I reviewed and suggested next steps. Free for one agreed workflow; larger or complex reviews are scoped as paid assessments.

It is not a comprehensive penetration test, and active testing needs written authorization.

Book a review(opens in new tab)

Included

  • One agreed question, sized to your application
  • A brief record of what was checked
  • Validated observations and suggested next steps

This review is not

  • A full penetration test
  • Compliance certification
  • Assurance that an entire application is secure

What I assess · For technical readers

Coverage selected for your application

  • Web applications and APIs

    Inputs, endpoints, request handling, files and server behavior. Testing may cover injection, XSS, SSRF, path traversal and related weaknesses where relevant to the agreed application.

    • Injection
    • XSS
    • SSRF
    • Path traversal
  • Access control and tenant isolation

    Whether users, roles and tenants can access or modify records, documents or operations beyond their permissions. Coverage includes object-level and function-level authorization and direct API access.

    • Object-level authorization
    • Function-level authorization
    • Direct API access
  • Authentication and accounts

    Login, recovery, verification, sessions, token handling and sensitive account changes. The assessment follows the actual account flows and their abuse paths.

    • Login and recovery
    • Sessions
    • Tokens
  • Workflows, integrations and business logic

    Workflow and approval bypasses, integration permissions, unauthorized state transitions, repeated operations and concurrent requests. Check the application rules and trust boundaries across connected systems within the agreed scope.

    • Approval gates
    • Integration permissions
    • State transitions
  • AI and LLM features

    OWASP-informed testing of direct and document-based prompt injection, sensitive-data exposure and the permissions behind AI tools and connected workflows. Check whether untrusted content can trigger unintended actions or reach information beyond the user's access.

    • Prompt injection
    • Data exposure
    • Tool permissions
  • Configuration and exposed assets

    Relevant services, web configuration, TLS, storage permissions, signed URLs and dependency exposures within the agreed application scope.

    • TLS
    • Storage permissions
    • Signed URLs
    • Dependency exposures
  • Security-focused QA

    Boundary conditions, malformed payloads, validation gaps, file restrictions, data consistency and regressions with security implications.

    • Malformed payloads
    • Validation gaps
    • File restrictions
  • Reporting and remediation

    Validated findings, reproduction evidence, impact, proposed corrections and retesting of the changed behavior.

    • Evidence
    • Remediation
    • Retesting

Coverage is selected for the application, available access and agreed objectives. A list of testing techniques is not a claim that every technique applies to every system.

For technical readers · Conceptual view

Where each assessment area applies

A typical web, API and AI application, showing which parts each assessment area examines. Coverage for your application follows its actual architecture and the agreed scope.

Assessment areas

Permission and logic checks

  • Access control and tenant isolation
  • Business logic
  1. People and roles

    • Users and roles
    • Customer accounts (tenants)
    • Sessions and tokens
    • Authentication and accounts
    • Access control and tenant isolation
  2. Web application and API

    • Pages and forms
    • API endpoints
    • File uploads
    • Web applications and APIs
    • Security-focused QA
  3. Permission and logic checks

    • Object-level and function-level authorization
    • Workflow state and approvals
    • Repeated and concurrent requests

    Where the application decides who can do what

    • Access control and tenant isolation
    • Business logic
  4. Data and files

    • Customer records
    • Documents and storage
    • Signed URLs
    • Access control and tenant isolation
    • Configuration and exposed assets
  5. Untrusted content the AI reads

    • Text typed by users
    • Uploaded or retrieved documents
    • AI and LLM features
  6. AI-driven functionality

    • Prompts and instructions
    • Information it can reach
    • Actions it can trigger
    • Requests pass through the permission checks
    • AI and LLM features
  7. Configuration and exposed assets

    • Relevant services
    • Web configuration and TLS
    • Storage permissions
    • Dependency exposures
    • Configuration and exposed assets
Conceptual view of a typical web, API and AI application · not a client system
Request and information flow
Where access decisions are enforced

How the work proceeds

Scope. Test. Report. Fix. Retest.

Six stages, each with something you receive. Who makes the fix, and whether a retest is included, is agreed for each engagement.

  1. 01 · Before testing

    Stage 1, before testing: Set the target

    Agree the application, workflow, roles and the question to answer.

    You get: Assessment question and scope

  2. 02 · Before testing

    Stage 2, before testing: Agree boundaries

    Authorization, test accounts, environment, methods and evidence handling.

    You get: Signed-off testing boundaries

  3. 03 · Testing

    Stage 3, testing: Test and validate

    Manual testing with relevant tools, then confirm the impact of meaningful findings.

    Manual validation

    You get: Validated findings

  4. 04 · After testing

    Stage 4, after testing: Report

    Scope, validated issues, limits and recommended fixes, in priority order.

    You get: Report with fix guidance

  5. 05 · After testing

    Stage 5, after testing: Fix

    Your team makes the changes, or I do when that is in scope.

    Agreed per engagement

    You get: Corrected code or configuration

  6. 06 · After testing

    Stage 6, after testing: Retest

    Repeat the original test and check nearby behavior after the fix.

    You get: Retest results, when included

What you get from each stage
Manual validation
Agreed per engagement

Assessment decisions

Decisions that shape an assessment

Six choices that keep results specific to your application and clear about their limits.

  • Manual testing, supported by tools

    Tools support discovery and investigation. Relevant findings are manually examined for validity, exploitability and application impact.

    • Manual testing
    • Tool-assisted discovery
  • Coverage chosen for the application

    Areas and techniques are selected for the application, available access and agreed objectives.

    • Scope
    • Objectives
  • Staging and test accounts as a starting point

    The environment and methods are agreed before testing. A suitable staging setup with test accounts is often the practical starting point. Production testing requires explicit scope and authorization.

    • Staging
    • Test accounts
    • Production by agreement
  • Impact explained for this system

    Impact and priority explain what the weakness enables and why it matters in this system.

    • Impact
    • Priority
  • Sensitive material handled appropriately

    Handling of evidence is agreed before testing. Findings include relevant evidence, with sensitive material handled appropriately.

    • Evidence handling
  • Retest the change and related behavior

    When included, retesting checks the original behavior and relevant regressions after correction, and records any remaining limits.

    • Retest
    • Regression check

Limits

What an assessment does and does not establish

Results describe the behavior observed within the agreed and tested scope.

An assessment can establish

  • Validated findings within the agreed and tested scope
  • A record of the application areas, roles and conditions actually assessed
  • Whether reported behavior is resolved, partially resolved or still reproducible, when retesting is included

It does not establish

  • That an entire application is secure
  • That all application risks have been eliminated, even after a passed retest
  • Compliance certification

The report excerpts and screens on this page are illustrations with fictional data, and the questions are examples. None is a finding about your product or any client’s application.

Track record

Client assessments, kept confidential

I have delivered security assessments for client applications. Client names, systems and findings stay under NDA, which is why the examples on this page are fictional.

  • Assessments delivered

    For client applications, scoped and authorized in advance.

  • Teams in Poland and Texas, USA

    Remote engagements with teams in two countries.

  • Under NDA

    Client names, systems and findings are not published.

Part of: Level 03 · Product & solution engineering

Related engineering work

Implemented intake workflow

Explore its engineering scope, review controls and confidentiality boundaries. This is engineering evidence; it does not document an application security assessment or its findings.

Read the intake case study

Define the security question you need answered

Share the type of application, the workflow you are concerned about and whether you need an assessment, remediation, or both. We can agree the next step from there.

Book a call(opens in new tab)

Choose a time on Calendly.

Prefer email? hkhantanoli@gmail.com(opens in new tab)

What to share

  • The type of application
  • The workflow you are concerned about
  • Whether you need an assessment, remediation or both

Please leave out passwords, access keys and sensitive data. Access and testing boundaries are agreed before any testing begins.