Algorithm Search⌘K

Definitionadvanced

Noninterference

Also called secure information flow.

A program is noninterfering if its public outputs do not depend on its secret inputs, a property checked by type systems or analysis.

Noninterference says that the public outputs of a program depend only on its public inputs: if two runs start with the same public values, they end with the same public values, whatever the secrets were. It is the standard meaning of "the program does not leak its secrets", and it covers both direct copies of a secret and leaks through the control flow. It is a property of pairs of runs, not of single runs, so one Hoare triple cannot state it; it is a 2-safety property, and self-composition turns it into an ordinary safety property. Security type systems check a stronger condition that implies it.

Definition

Setting. A program PP in a small deterministic while language runs over integer variables. Each variable has a level: low (LL, public) or high (HH, secret). A state ss maps the variables to integers, and two states are low-equivalent, s=Lts =_L t, if they agree on every low variable. [ ⁣[P] ⁣](s)[\![P]\!](s) is the final state of the run of PP from ss, or ⊥\bot if the run does not stop.

Noninterference (termination-insensitive). PP is noninterfering if for all states s1=Ls2s_1 =_L s_2, whenever [ ⁣[P] ⁣](s1)=t1≠⊥[\![P]\!](s_1) = t_1 \ne \bot and [ ⁣[P] ⁣](s2)=t2≠⊥[\![P]\!](s_2) = t_2 \ne \bot, then t1=Lt2t_1 =_L t_2.

Termination-sensitive noninterference adds: [ ⁣[P] ⁣](s1)=⊥[\![P]\!](s_1) = \bot if and only if [ ⁣[P] ⁣](s2)=⊥[\![P]\!](s_2) = \bot. So the secret cannot decide whether the program stops.

More levels. With a lattice of levels, as in Denning's model, PP is noninterfering if for every level ℓ\ell the inputs at levels at or below ℓ\ell fix the outputs at levels at or below ℓ\ell. The two-level case is the one above. For nondeterministic or concurrent programs the usual form is possibilistic: for s1=Ls2s_1 =_L s_2, every final state from s1s_1 is low-equivalent to some final state from s2s_2.

Runs and k-safety. A run of PP is a pair (s,t)(s, t) with [ ⁣[P] ⁣](s)=t≠⊥[\![P]\!](s) = t \ne \bot. A property of programs is a trace property if there is a set Π\Pi of runs such that PP has the property exactly when every run of PP is in Π\Pi. It is a k-safety property, as Terauchi and Aiken call it, if there is a set BB of kk-tuples of runs such that PP has the property exactly when no kk runs of PP form a tuple in BB.

Theorem. (1) Noninterference is a 2-safety property. (2) It is not a trace property. (3) It is undecidable.

Proof. (1) Let BB be the set of pairs ((s1,t1),(s2,t2))((s_1, t_1), (s_2, t_2)) with s1=Ls2s_1 =_L s_2 and t1≠Lt2t_1 \ne_L t_2. By the definition, PP is noninterfering exactly when no two runs of PP form a pair in BB.

(2) Suppose Π\Pi is a set of runs that defines noninterference as a trace property. Take one low variable ll and one high variable hh, and the program P=(l:=h)P = (l := h). Its runs are the pairs (s,t)(s, t) with t(l)=t(h)=s(h)t(l) = t(h) = s(h). Fix one run (s,t)(s, t) and let c=s(h)c = s(h). The program l:=cl := c, for the constant cc, is noninterfering, since its low output is always cc. The run (s,t)(s, t) is one of its runs, so (s,t)∈Π(s, t) \in \Pi. This holds for every run of PP, so PP has the property. But PP leaks: the states with l=0,h=0l = 0, h = 0 and l=0,h=1l = 0, h = 1 are low-equivalent, and the outputs have l=0l = 0 and l=1l = 1. This contradicts the choice of Π\Pi.

(3) For a program QQ that does not use ll or hh, let PQ=(Q; l:=h)P_Q = (Q;\ l := h). If QQ stops, then PQP_Q leaks hh as in (2). If QQ does not stop, PQP_Q has no runs and is noninterfering. So a decision procedure for noninterference would decide the halting problem. This is also an instance of Rice's theorem. The complement is recursively enumerable, since one can search over pairs of inputs and run them. □\square

Termination-sensitive noninterference is not a 2-safety property: a violation can need a run that does not stop, and no finite part of it shows the violation.

Examples and non-examples

Take ll low and hh high.

program noninterfering? why
l:=hl := h no explicit flow: h=0h = 0 and h=1h = 1 give different ll
if h>0 then l:=1 else l:=0\mathbf{if}\ h > 0\ \mathbf{then}\ l := 1\ \mathbf{else}\ l := 0 no implicit flow: no assignment copies hh, but the branch does
l:=h; l:=0l := h;\ l := 0 yes the final ll is always 0
l:=h−hl := h - h yes the final ll is always 0
h:=l+1h := l + 1 yes flow from low to high is allowed
while h>0 do skip\mathbf{while}\ h > 0\ \mathbf{do}\ \mathbf{skip} yes, termination-insensitive; no, termination-sensitive the secret decides whether the program stops
if h>0 then slow else skip; l:=0\mathbf{if}\ h > 0\ \mathbf{then}\ \mathit{slow}\ \mathbf{else}\ \mathbf{skip};\ l := 0 yes but the time it takes leaks hh, a timing attack that this definition does not model
l:=(h=guess)l := (h = \mathit{guess}) no a password check leaks one bit; real policies allow it with declassification

The third and fourth rows show that the definition is semantic. The flow-insensitive type system of Volpano, Irvine and Smith rejects l:=h; l:=0l := h;\ l := 0, because ll receives a high value at some point, and it rejects l:=h−hl := h - h too. Its soundness theorem says that typable programs are noninterfering; the converse fails, as it must, since the property is undecidable. A flow-sensitive analysis accepts the third row but still rejects the fourth.

A taint analysis tracks explicit flows only, so it does not prove noninterference: the implicit flow in the second row passes it. A check for noninterference must also mark everything assigned under a branch on a secret.

  • Safety and liveness. Safety and liveness properties are trace properties. Noninterference is neither, because it compares runs. Clarkson and Schneider call such a property a hyperproperty, a set of sets of traces, and noninterference is a safety hyperproperty.
  • Self-composition. Because noninterference is 2-safety, it holds exactly when a program that runs two renamed copies of PP one after the other satisfies the safety triple {l1=l2} P1;P2 {l1=l2}\{l_1 = l_2\}\ P_1; P_2\ \{l_1 = l_2\}. See self-composition.
  • Program equivalence. Noninterference says that PP is equivalent to itself when the inputs are related by =L=_L and the outputs are compared by =L=_L. It is a relational property, like the equivalence of a program and its compiled form in translation validation.
  • Type soundness. A security type system is sound when every typable program is noninterfering. This is the analog of type soundness, but it is stated about two runs.
  • Timing and constant-time code. If the time of a run is an output, the definition becomes "constant-time" execution, the usual defense in cryptographic code.

References

  1. Joseph A. Goguen and Jose Meseguer, Security policies and security models, Proceedings of the 1982 IEEE Symposium on Security and Privacy, pp. 11 to 20, the definition of noninterference between groups of users of a system
  2. Dorothy E. Denning, A lattice model of secure information flow, Communications of the ACM 19(5), 1976, pp. 236 to 243, security classes ordered in a lattice and the explicit and implicit flows of a program
  3. Dennis Volpano, Cynthia Irvine and Geoffrey Smith, A sound type system for secure flow analysis, Journal of Computer Security 4(2-3), 1996, pp. 167 to 187, the security type system for a while language and its soundness theorem, which states noninterference for typable programs
  4. Andrei Sabelfeld and Andrew C. Myers, Language-based information-flow security, IEEE Journal on Selected Areas in Communications 21(1), 2003, pp. 5 to 19, the semantic definition of noninterference, termination and timing channels, and declassification
  5. Tachio Terauchi and Alex Aiken, Secure information flow as a safety problem, Proceedings of SAS 2005, LNCS 3672, the definition of 2-safety and the observation that noninterference is a 2-safety property and not a safety property
  6. Michael R. Clarkson and Fred B. Schneider, Hyperproperties, Journal of Computer Security 18(6), 2010, pp. 1157 to 1210, hyperproperties as sets of trace properties, and noninterference as a hyperproperty that is not a trace property

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/DQHM28/text.yaml