Algorithm Search⌘K

Definitioncore

Implicit flow

Also called indirect flow, control dependence flow.

Flow of information from a secret condition to a variable assigned in a branch, even when the secret value is never copied.

An implicit flow is a flow of information from the condition of a branch or a loop to a variable that the branch assigns. No assignment copies the secret, but the value of the variable after the branch tells which way the branch went, and so tells something about the condition. Denning and Denning (1977) named the two kinds of flow, explicit (through an assignment) and implicit (through the control flow), in the lattice model. A checker that sees only explicit flows, as most taint analyses do, misses implicit flows and so does not give noninterference.

Definition

Setting. A program is in a small while language with assignments x:=ex := e, sequences, if statements and while loops. Each variable xx has a class Γ(x)\Gamma(x) in a security lattice (L,≤,⊔,⊓)(\mathcal{L}, \le, \sqcup, \sqcap), where ℓ1≤ℓ2\ell_1 \le \ell_2 means that information may flow from ℓ1\ell_1 to ℓ2\ell_2. The label of an expression, label(e)\mathrm{label}(e), is the join of the classes of its variables.

Explicit flow. An assignment x:=ex := e makes an explicit flow from each variable of ee to xx.

Implicit flow. Let SS be an if statement or a while loop with condition ee. A statement TT is in the scope of SS if TT is in a branch or in the body of SS. Then each assignment x:=e′x := e' in the scope of SS makes an implicit flow from each variable of ee to xx. The flow happens on every run that tests ee, also on a run where the assignment does not execute: the fact that xx keeps its old value is itself information about ee.

For programs with arbitrary jumps, the scope of a branch is the set of nodes that are control dependent on it in the control flow graph: the nodes between the branch and its immediate post-dominator. This is the control dependence of the program dependence graph.

The program counter class. A checker accounts for implicit flows with a class pcpc for the program counter. At the start pc=⊥pc = \bot. In the scope of a branch on ee, the checker uses pc⊔label(e)pc \sqcup \mathrm{label}(e), and at the end of the scope it restores the old value. An assignment x:=e′x := e' is allowed when

label(e′)⊔pc≤Γ(x).\mathrm{label}(e') \sqcup pc \le \Gamma(x).

The term label(e′)\mathrm{label}(e') covers the explicit flow and the term pcpc covers the implicit flows.

Syntactic and semantic flows. The definition above is syntactic: it says where a flow can happen. A flow from hh to xx happens in the semantic sense when two runs that differ only in hh end with different values of xx. Each semantic flow through the control flow is a syntactic implicit flow, but not each syntactic flow is a semantic one.

Examples and non-examples

Take hh high and ll low, in the two-point lattice L≤HL \le H.

  • A copy of one bit. if h then l := 1 else l := 0. After the run, l=1l = 1 exactly when h≠0h \ne 0. No assignment reads hh, and the flow is implicit.

  • The branch that does not run. Denning and Denning give y := 1; if x = 0 then y := 0. Take xx high and yy low. If x≠0x \ne 0 the assignment y:=0y := 0 does not run, but y=1y = 1 still shows that x≠0x \ne 0. A run-time check that looks only at the assignments that run misses this flow. Fenton (1974) found the same problem in his data mark machine.

    xx runs y:=0y := 0? final yy
    0 yes 0
    1 no 1
    2 no 1
  • A copy of a whole value. l := 0; while h > l do l := l + 1, for h≥0h \ge 0. The loop ends with l=hl = h, so the loop copies hh to ll through implicit flows only.

  • Two steps. if h then m := 1 else m := 0; l := m, with mm low. The flow from hh to mm is implicit and the flow from mm to ll is explicit. The checker rejects the first assignment, because pc=Hpc = H and Γ(m)=L\Gamma(m) = L.

  • Non-example: a flow to a high variable. if h then h2 := 1, with h2h2 high. This is an implicit flow, but it is allowed, since H≤HH \le H.

  • Non-example: a low condition. if l then h := 0 else l := 2. The flows go from ll to hh and from ll to ll, and both are allowed.

  • Syntactic but not semantic. if h then l := 0 else l := 0. The definition gives an implicit flow from hh to ll, but l=0l = 0 after each run, so no information flows. A sound static checker still rejects this program.

  • Not an implicit flow: termination. while h = 0 do skip; l := 1. The assignment to ll is after the loop, not in its scope. The secret decides only whether the program stops. This is a termination channel. Termination-insensitive noninterference ignores it, and a checker in the style above accepts this program.

  • Noninterference is the semantic property that a sound treatment of explicit and implicit flows gives. A program with no disallowed semantic flow of either kind is noninterferent.
  • Security type system. The implicit flow is the phenomenon. The type system of Volpano, Irvine and Smith is the algorithm that checks it with the program counter class above, and its soundness theorem shows that this check is enough for TINI.
  • Taint analysis tracks explicit flows only in most tools. It is useful to find a copy of untrusted input in a dangerous place, but it does not show that a secret stays secret.
  • Dynamic monitors. At run time the branch that does not run is not seen. The no-sensitive-upgrade check stops the run instead, secure multi-execution runs the program once per level, and faceted execution keeps a value for each observer.
  • Covert channels such as the termination and timing channels carry information through how the program runs, not through the final values. They are outside the definition above.
  • Program slicing and the program dependence graph use the same control dependence. A backward slice of xx contains each branch that makes an implicit flow to xx.

References

  1. Dorothy E. Denning and Peter J. Denning, Certification of programs for secure information flow, Communications of the ACM 20(7), 1977, pp. 504 to 513; Section 2.2, explicit and implicit flows and the example y := 1; if x = 0 then y := 0; Section 3, the certification of if and while statements
  2. Dorothy E. Denning, A lattice model of secure information flow, Communications of the ACM 19(5), 1976, pp. 236 to 243, flows caused by the execution of conditional structures
  3. J. S. Fenton, Memoryless subsystems, The Computer Journal 17(2), 1974, pp. 143 to 147, the data mark machine and the leak through a branch that does not run
  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, implicit flows and the program counter label in security type systems

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/8ST8W9/text.yaml