Common SCADA vulnerabilities in SCADA systems - Time & Space 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?
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.
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.
As the number of devices and services grows, the checks increase.
| Input Size (n devices) | Approx. Operations (services per device = 5) |
|---|---|
| 10 | 50 |
| 100 | 500 |
| 1000 | 5000 |
Pattern observation: The total checks grow roughly in direct proportion to the number of devices and their services.
Time Complexity: O(n * m)
This means the time grows with the number of devices (n) times the number of services per device (m).
[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.
Understanding how scanning time grows helps you design better security checks and explain your approach clearly in conversations.
"What if we only scanned devices with known vulnerabilities? How would the time complexity change?"