0
0
SCADA systemsdevops~5 mins

Common SCADA vulnerabilities in SCADA systems - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Common SCADA vulnerabilities
O(n * m)
Understanding Time Complexity

We want to understand how the time to detect or exploit vulnerabilities in SCADA systems grows as the system size increases.

How does the effort change when more devices or components are involved?

Scenario Under Consideration

Analyze the time complexity of scanning a SCADA network for common vulnerabilities.


    function scanVulnerabilities(devices) {
      for (let i = 0; i < devices.length; i++) {
        let device = devices[i];
        for (let j = 0; j < device.services.length; j++) {
          checkServiceVulnerability(device.services[j]);
        }
      }
    }
    

This code checks each device and its services for vulnerabilities.

Identify Repeating Operations

Look at the loops that repeat work.

  • Primary operation: Checking each service on every device.
  • How many times: Once for each service on each device.
How Execution Grows With Input

As the number of devices and services grows, the checks increase.

Input Size (n devices)Approx. Operations (services per device = 5)
1050
100500
10005000

Pattern observation: The total checks grow roughly in direct proportion to the number of devices and their services.

Final Time Complexity

Time Complexity: O(n * m)

This means the time grows with the number of devices (n) times the number of services per device (m).

Common Mistake

[X] Wrong: "Checking one device means checking all devices takes the same time."

[OK] Correct: More devices and services mean more checks, so time grows with system size, not stays the same.

Interview Connect

Understanding how scanning time grows helps you design better security checks and explain your approach clearly in conversations.

Self-Check

"What if we only scanned devices with known vulnerabilities? How would the time complexity change?"