Certopolis

Certified Information Systems Security Professional (CISSP)

SAST vs DAST vs fuzzing: software verification (CISSP)

NIST IR 8397 divides analysis into code-based or static analysis, such as SAST, which reasons about the code as written without running it, and execution-based or dynamic analysis, such as DAST, which runs the program. A fuzzer is automated dynamic testing that creates huge numbers of inputs and watches for gross failures such as crashes.

What does static analysis find and miss?

A static code scanner reasons about the code as written, in somewhat the way a human reviewer does, and is independent of program execution. IR 8397 says static analysis should be done as soon as code is written, and small pieces can be checked before large executable pieces are complete.

IR 8397 also recommends heuristic tools that examine the code for hardcoded passwords and private encryption keys, and notes that dynamic testing is unlikely to uncover such code.

SAST has weaknesses. Certain vulnerabilities are difficult for it to find, such as authentication problems, access control issues and insecure use of cryptography. In almost all tools some warnings are false positives.

What does dynamic analysis add?

Dynamic analysis runs the program. Black box test cases are based on functional specifications or requirements and not on the code. They include negative tests, which use invalid inputs and test what the software should not do, plus input boundary analysis and input combinations.

Code-based, or structural, test cases come from the implementation. IR 8397 recommends that the test suite reach at least 80 % statement coverage. Test cases created to show the presence, and later the absence, of a specific bug are sometimes called regression tests.

If the software provides a web service, IR 8397 says to use a DAST tool such as a web application scanner, or an IAST tool. Included libraries should be verified too, and components must be continually monitored against databases of known vulnerabilities, because a new vulnerability in existing code may be reported at any time.

Mutation-based or generation-based fuzzing?

A fuzzer can try an immense number of inputs with minimal human supervision. IR 8397 names one key benefit: fuzzing typically produces actual positive tests for bugs, not just static warnings, and the triggering input can be saved and added to the regular tests.

Mutation-based fuzzing modifies existing inputs, for example from unit tests. It is easy to set up because it needs little or no description of the input structure. Generation-based fuzzing produces random inputs from a formal grammar of well-formed inputs. It can pass the program's validation and reach deeper logic, but typically takes far more time and expertise to set up.

Where the exam catches people

  • Believing SAST alone covers a web application: authentication problems, access control issues and insecure use of cryptography are difficult for static tools to find.
  • Believing dynamic testing is the way to find hardcoded passwords and keys: IR 8397 recommends heuristic tools that examine the code and says dynamic testing is unlikely to find them.
  • Believing generation-based fuzzing is the quick option: it needs a formal grammar and more expertise, and mutation-based fuzzing starts from existing inputs.
  • Believing static warnings and fuzzer findings need the same triage: a fuzzer failure comes with an input that actually triggers the bug.
  • Believing a one-time check of open-source components is enough: components must be monitored continually against known-vulnerability databases.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A small team wants an automated fuzzer running against its file parser within days. No one on the team has fuzzing expertise, and it has hundreds of valid files from its unit tests to draw on. Under NIST IR 8397, which fuzzing approach best fits?

    Right. In the game that’s Renown for your Domain 6: Security Assessment and Testing building.

    Not that one: C is right. In the game your Domain 6: Security Assessment and Testing building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Generation-based fuzzing builds inputs from a formal grammar and can pass validation for deeper testing, but typically needs far more time and expertise to set up.

    Written from nvlpubs.nist.gov/nistpubs/ir/2021/NIST.IR.8397.pdf

  2. A product team will add one automated security verification technique to its release pipeline. Its developers have little time for triage, so each weakness the technique reports should be one they can treat as real rather than a possible false alarm. Under NIST IR 8397, which technique best meets this need?

    Right. In the game that’s Renown for your Domain 6: Security Assessment and Testing building.

    Not that one: C is right. In the game your Domain 6: Security Assessment and Testing building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Its section 3.6 says that in almost all static analysis tools some warnings are false positives, and tools usually cannot determine whether a weakness is an actual vulnerability or is mitigated. For findings the team can act on without triage, dynamic testing fits.

    Written from nvlpubs.nist.gov/nistpubs/ir/2021/NIST.IR.8397.pdf

  3. Before each release of a network service that parses a complex binary protocol, a security lead wants an automated check that sends immense numbers of malformed and unexpected messages to the running service, with minimal human supervision, and flags any crash. Which technique fits?

    Right. In the game that’s Renown for your Domain 6: Security Assessment and Testing building.

    Not that one: C is right. In the game your Domain 6: Security Assessment and Testing building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    NIST IR 8397 says this generality lets a fuzzer try an immense number of inputs with minimal human supervision, which is exactly what the security lead wants for the protocol parser.

    Written from nvlpubs.nist.gov/nistpubs/ir/2021/NIST.IR.8397.pdf

Ask for something