Section 1.45

Security claim scope

Definition

Security claim scope is the exact set of situations that a security claim covers: which software artifact (the source version, the build options and the resulting program file), which hardware and environment, which inputs and workloads, which attacker capabilities, which property, and which kind of evidence. A claim is supported only inside its scope. Outside the scope the claim is not refuted, but it is not supported either, because nothing there was checked. Stating the scope turns “the system is secure” into a statement that someone else can check.

The idea

A test campaign runs one firmware build on one circuit board with two simultaneous connections. Every malformed message is rejected and every message is handled before its deadline. A summary then says: “the firmware rejects malformed input and meets its deadlines.” That sentence is supported for the build, the board and the connection count that were tested. Whether it holds for a build with an optional feature switched on, for a different board or for six connections, the campaign did not show. A reader of the summary cannot tell which of these the evidence covers.

A load test on a bridge is a fair picture. A 20-tonne truck crosses safely. That supports a claim about trucks of up to 20 tonnes on that bridge in that weather. It says nothing about 40 tonnes, and nothing about the bridge next to it, however similar the two look. The picture stops being accurate in one respect: trucks do not search for the load a bridge cannot carry, but an attacker does search for the configuration, input or timing that lies outside the evidence. A claim stretched beyond its scope tells an attacker where to look.

How it works

State a claim along six dimensions.

Different kinds of evidence cover different scopes. A test covers a finite set of runs of one compiled artifact. A proof covers every input of a model, a mathematical description of the system, but only if the premises the proof assumes are true, such as a correct compiler or a correct library function. A code review covers the source paths that the reviewer read, without running them. A measurement campaign covers the conditions measured, with the uncertainty of any finite sample. The kind of evidence belongs in the claim.

Extending a claim to a configuration that was not covered needs one of three arguments.

  1. Independence: the property does not depend on the dimension that differs. This needs an argument from the code, for example that the changed option compiles no code on the path the property concerns.

  2. A model: a model whose assumptions hold for the new configuration predicts the property there, for example a worst-case timing formula in terms of the number of connections.

  3. New evidence: the property is tested, measured or proved again for the new configuration.

Re-running only the checks that a change can affect, and recording which earlier results were reused and why, is called incremental validation §10.42.

The size of a change does not decide its effect. Rewording a comment usually changes no compiled code, but not always. Before a C program is compiled, each __LINE__ in it is replaced by the number of the line it is on, and C’s assert check, which stops the program when a stated condition is false, uses that number to report where the check failed. A comment that grows by one line therefore moves every later line number and can change the compiled code below it. Switching on one compiler option §12.3 can replace the code that handles every message. What matters is whether the change can reach the property, not how many lines it touches.

Worked example

A firmware has 4 optional features, each on or off, and supports 1 to 4 simultaneous connections. The number of configurations is 24×4=16×4=642^4 \times 4 = 16 \times 4 = 64. A campaign tests one build with 2 connections, which is 1 of the 64 configurations.

One optional feature is a just-in-time compiler §2.14, which translates the message-handling program into machine code before running it, instead of running it one instruction at a time in an interpreter §2.13. The interpreter checks every memory access against the bounds of the buffer; the generated machine code must contain checks of its own. Tests of the interpreter build say nothing about the machine code, because different code runs. The claim “memory accesses stay inside the buffer” extends to the just-in-time build only through new tests or a proof about the generated code.

Now take the claim “every event is handled within 5 ms”. The response time §9.32 of an event is the time from its arrival to the end of its handling. Assume that one processor handles events one at a time, in order of arrival and without interruption; that each connection has at most one event waiting or in progress; and that handling one event takes at most 1.5 ms. In the worst case an event arrives just after one event from every other connection, the first of which has just started. With nn connections it waits for n−1n - 1 events and is then handled itself, so the worst-case response time is n×1.5n \times 1.5 ms.

The campaign at 2 connections observed a largest response time of 2.6 ms, well below 5 ms, and still the claim fails at 4 connections. The observation did not even reach the worst case of its own configuration, 3.0 ms. The model reached configurations that the test did not, and it showed where the claim stops. Stated within its scope, the claim reads: “with at most 3 connections, and under the three assumptions above, every event is handled within 5 ms.” If the firmware refuses a fourth connection, that limit is a rule enforced by the code and may be part of the scope. A limit enforced by code holds in every run; a largest value that was merely observed holds only for the runs that were made.

Stated precisely

A scoped claim has the form: for the artifact aa, on the platform pp, for every input in the set II, against an attacker with the capabilities CC, the property Φ\Phi holds, as established by the evidence EE. Each symbol names one dimension of the scope. For a test, II is the finite list of inputs that ran. For a proof, II is every input that the proof’s model allows, and the proof’s premises become part of the claim.

The quantifier in a claim must match its evidence. “In each of these 10,000 runs no access left the buffer” is supported by 10,000 passing runs. “No access ever leaves the buffer” covers all inputs, and is supported only by a proof or by a test of every input in a finite input set. Words such as every, never, always and maximum make claims about all cases.

A claim transfers from a configuration xx to a configuration yy only if at least one of the following is established: Φ\Phi does not depend on any dimension in which xx and yy differ; a model whose assumptions hold at yy implies Φ\Phi at yy; or there is evidence for Φ\Phi at yy itself.

Limits and common mistakes

“Secure”, “verified” and “tested” without a scope say nothing that can be checked. Ask which artifact, which property, against which attacker and by which evidence.

An absence of observed failures is not a proof that failures are absent. A test that found no failure supports the claim for the runs that were made. The largest value seen in a measurement is not the largest possible value.

A proof has a scope too. A proof about the source code says nothing about the compiled program unless the compiler is covered, and nothing about a library function whose behavior the proof assumed.

Reusing old evidence after a change needs a stated reason. A change to a shared interface, a library, a compiler option or the scheduler can break an assumption far from the file that was edited.

Carrying a result from the conditions of a study to other conditions is the statistical question of external validity §11.44. Configurations raise the same question, and the same care applies.

A narrow scope is not a weakness. A claim with its scope stated can be checked and built on. An overstated claim invites a counterexample that discredits its true part as well.

Questions answered

Does a result for one build and connection count apply to all configurations?

No, not by itself. A result supports a claim only within its scope: the build that was tested, the number of connections used, the hardware and the inputs that ran. It extends to another configuration only through one of three arguments. Either the property cannot depend on what differs, for example because the other build differs only in comments and compiles to exactly the same program file. Or a model whose assumptions hold for the other configuration predicts the property there, such as a worst-case timing formula in the number of connections. Or the property is tested or proved again for that configuration. Without one of these, the other configurations are untested, not confirmed.

Connection count is a typical trap for timing claims. If each of nn connections can have one event of up to 1.5 ms waiting, the worst response time is n×1.5n \times 1.5 ms: 3.0 ms with 2 connections and 6.0 ms with 4, so a 5 ms deadline met with 2 connections is missed with 4. Build options are a typical trap for memory-safety claims: a build that switches on a just-in-time compiler runs different code from the interpreter build that was tested.

Related entries: Assumption versus guarantee (§1.36), Mechanism versus evidence (§1.37), Artifact provenance (§13.1), Incremental validation (§10.42), External validity (§11.44).