0
0
Cybersecurityknowledge~5 mins

Why web apps are primary targets in Cybersecurity - Performance Analysis

Choose your learning style9 modes available
Time Complexity: Why web apps are primary targets
O(n*m)
Understanding Time Complexity

We want to understand how the effort to attack web apps grows as their size and complexity increase.

How does the number of possible attack points change when web apps get bigger or more complex?

Scenario Under Consideration

Analyze the time complexity of scanning a web app for vulnerabilities.


for each page in web_app:
    for each input_field in page:
        test common attacks on input_field
        log results
    end
end
    

This code simulates testing every input field on every page of a web app for common security issues.

Identify Repeating Operations

Look at what repeats in the scanning process.

  • Primary operation: Testing each input field for attacks.
  • How many times: Once for every input field on every page.
How Execution Grows With Input

As the number of pages and input fields grows, the testing effort grows too.

Input Size (pages x inputs)Approx. Operations
10 pages x 5 inputs50 tests
100 pages x 5 inputs500 tests
1000 pages x 5 inputs5000 tests

Pattern observation: The number of tests grows directly with the number of pages and inputs combined.

Final Time Complexity

Time Complexity: O(n*m)

This means the testing effort grows proportionally to the number of pages and input fields.

Common Mistake

[X] Wrong: "Testing one page means testing the whole app quickly."

[OK] Correct: Each page and input adds more work, so testing grows with app size, not stays the same.

Interview Connect

Understanding how attack effort grows helps you explain why web apps need careful security checks as they grow.

Self-Check

"What if the app had many pages but only one input each? How would that affect the testing effort?"