Algorithm Search⌘K

Theoremcore

Undecidability of safety in the HRU model

Also called HRU safety theorem, Harrison-Ruzzo-Ullman theorem.

Whether some command sequence can enter a given right into a cell of the access matrix that lacked it is undecidable for HRU systems, and NP-complete for mono-operational ones.

The safety theorem of Harrison, Ruzzo and Ullman (1976) says that no algorithm can decide, for every protection system of the HRU model, whether a given right can ever be entered into a cell of the access matrix that did not hold it. The proof builds, for each Turing machine, a protection system whose commands do the moves of the machine, so a decision procedure for safety would solve the halting problem. The same paper shows that the question becomes decidable, and NP-complete, when each command has only one primitive operation. The theorem is about the class of all HRU systems: one particular system can still have a decidable safety question, as the Take-Grant model does.

Statement

The definitions are those of the HRU model. A protection system is a finite set RR of generic rights and a finite set CC of commands. A configuration Q0=(S0,O0,A0)Q_0 = (S_0, O_0, A_0) is unsafe for rr if some sequence of command calls reaches a configuration QQ from which some call leaks rr, that is, enters rr into a cell that did not hold rr. This is the first version of safety in the paper, where the leak may go to any cell.

Problem SAFETY. The input is a finite description of a protection system (R,C)(R, C), a configuration Q0Q_0 and a right r∈Rr \in R. The question is: is Q0Q_0 safe for rr? Decidability is in the Turing machine model.

Theorem (HRU 1976, Theorem 2). SAFETY is undecidable. The set of unsafe instances is recursively enumerable, so the set of safe instances is not recursively enumerable.

Companion results in the same paper:

  • (Theorem 1) If every command is mono-operational, that is, its body has exactly one primitive operation, SAFETY is decidable. With the commands as part of the input, it is NP-complete. Tripunitara and Li (2013) corrected the proof of membership in NP.
  • (Theorem 3) If no command creates a subject or an object, SAFETY is PSPACE-complete.

In plain words

An operating system keeps a table of who may do what to which file. Programs change the table with a fixed list of simple commands. Each command checks some entries and then adds or removes rights, or makes or removes users and files. The safety question asks whether a right, such as read on a secret file, can ever end up somewhere new. You might hope that a tool could answer this for any list of commands. The theorem says no tool can. The reason is that such a table, with the right commands, can act as a general computer: each user is a cell of memory and each command is one step of a program. So asking whether a right leaks is the same as asking whether a program ever stops, and that question has no general answer.

Proof

The proof reduces the halting problem to unsafety. It is the construction of HRU, Section 5.

The machine. Let MM have states KK, tape symbols Γ\Gamma with blank BB, start state q0q_0, a final state qf≠q0q_f \ne q_0 and a partial transition function δ:K×Γ→K×Γ×{L,R}\delta : K \times \Gamma \to K \times \Gamma \times \{L, R\}. The tape has a left end and is infinite to the right. We may assume three things, by the usual small changes to MM: MM never moves left from cell 1, δ(qf,X)\delta(q_f, X) is undefined for all XX, and MM halts on the empty tape if and only if it enters qfq_f. Whether a given MM started on the empty tape enters qfq_f is undecidable; this is the halting problem on the empty tape.

The rights. Let R=K∪Γ∪{own,end}R = K \cup \Gamma \cup \{own, end\}, with the three parts disjoint.

The encoding. A configuration of MM with tape X1X2⋯XkX_1 X_2 \cdots X_k (the used cells), head on cell jj and state qq is encoded by subjects s1,…,sks_1, \ldots, s_k and no other objects, with

  • Xi∈A[si,si]X_i \in A[s_i, s_i] for each ii, and q∈A[sj,sj]q \in A[s_j, s_j];
  • own∈A[si,si+1]own \in A[s_i, s_{i+1}] for 1≤i<k1 \le i < k, and end∈A[sk,sk]end \in A[s_k, s_k];
  • no other rights in any cell.

The commands. For each pair with δ(q,X)=(p,Y,L)\delta(q, X) = (p, Y, L):

CqX(s,s′): if own∈A[s,s′] and q∈A[s′,s′] and X∈A[s′,s′] then delete q,X from A[s′,s′]; enter p into A[s,s]; enter Y into A[s′,s′].C_{qX}(s, s'):\ \textbf{if } own \in A[s, s'] \textbf{ and } q \in A[s', s'] \textbf{ and } X \in A[s', s'] \textbf{ then } \text{delete } q, X \text{ from } A[s', s'];\ \text{enter } p \text{ into } A[s, s];\ \text{enter } Y \text{ into } A[s', s'].

For each pair with δ(q,X)=(p,Y,R)\delta(q, X) = (p, Y, R), two commands. The first moves right inside the used part of the tape, and the second moves past the last used cell:

CqX(s,s′): if own∈A[s,s′] and q∈A[s,s] and X∈A[s,s] then delete q,X from A[s,s]; enter Y into A[s,s]; enter p into A[s′,s′].C_{qX}(s, s'):\ \textbf{if } own \in A[s, s'] \textbf{ and } q \in A[s, s] \textbf{ and } X \in A[s, s] \textbf{ then } \text{delete } q, X \text{ from } A[s, s];\ \text{enter } Y \text{ into } A[s, s];\ \text{enter } p \text{ into } A[s', s'].
DqX(s,s′): if end∈A[s,s] and q∈A[s,s] and X∈A[s,s] then delete q,X from A[s,s]; enter Y into A[s,s]; create subject s′; enter B,p,end into A[s′,s′]; delete end from A[s,s]; enter own into A[s,s′].D_{qX}(s, s'):\ \textbf{if } end \in A[s, s] \textbf{ and } q \in A[s, s] \textbf{ and } X \in A[s, s] \textbf{ then } \text{delete } q, X \text{ from } A[s, s];\ \text{enter } Y \text{ into } A[s, s];\ \text{create subject } s';\ \text{enter } B, p, end \text{ into } A[s', s'];\ \text{delete } end \text{ from } A[s, s];\ \text{enter } own \text{ into } A[s, s'].

The initial configuration Q0Q_0 has one subject s1s_1 with A[s1,s1]={q0,B,end}A[s_1, s_1] = \{q_0, B, end\}. It encodes the start of MM on the empty tape. The right to ask about is qfq_f.

Claim. Every configuration reachable from Q0Q_0 encodes a configuration of MM reachable from the start, up to the names of the subjects. A call changes the encoded configuration cc only if it does one move of MM from cc.

Proof of the claim, by induction on the number of steps. Q0Q_0 encodes the start. Let QQ encode cc, with tape X1⋯XkX_1 \cdots X_k, head on jj and state qq. A call whose condition fails leaves QQ unchanged. Consider a call whose condition holds.

  • Cq′X′(s,s′)C_{q'X'}(s, s') for a left move needs own∈A[s,s′]own \in A[s, s'], so s=sis = s_i and s′=si+1s' = s_{i+1} for some ii. It needs q′,X′∈A[si+1,si+1]q', X' \in A[s_{i+1}, s_{i+1}], so i+1=ji + 1 = j, q′=qq' = q and X′=XjX' = X_j, because only one state right and one symbol are present. Its body moves the state right to sj−1s_{j-1} and replaces XjX_j by YY. This is the left move of MM. Since j≥2j \ge 2 here, the case j=1j = 1 cannot arise, which matches the assumption that MM never moves left from cell 1.
  • Cq′X′(s,s′)C_{q'X'}(s, s') for a right move needs own∈A[s,s′]own \in A[s, s'] and q′,X′∈A[s,s]q', X' \in A[s, s], so s=sjs = s_j with j<kj < k, s′=sj+1s' = s_{j+1}, q′=qq' = q and X′=XjX' = X_j. Its body is the right move of MM.
  • Dq′X′(s,s′)D_{q'X'}(s, s') needs end∈A[s,s]end \in A[s, s], so s=sks = s_k, and q′,X′∈A[sk,sk]q', X' \in A[s_k, s_k], so j=kj = k, q′=qq' = q and X′=XkX' = X_k. The step is defined only if s′s' is a new name, since "create subject s′s'" is defined only then. Its body writes YY on cell kk, adds a cell k+1k + 1 holding BB with the head and state pp on it, and moves endend and the ownown chain to the new cell. This is the right move of MM off the used part of the tape. Two choices of the new name give configurations that differ only in that name.

In each case the result encodes the next configuration of MM, which proves the claim. Since δ\delta is a function, from each reachable configuration at most one command, with at most one choice of existing parameters, changes the state.

Leaks of qfq_f. By the claim, a call that enters a right into a cell from a reachable configuration is one of the commands above, doing one move of MM. The only enters of a state right are "enter pp", where pp is the new state of the move. The right qfq_f is not in any cell of an encoding until MM enters qfq_f, and qf≠q0q_f \ne q_0. So some reachable configuration leaks qfq_f if and only if MM, started on the empty tape, makes a move into qfq_f. By the assumption on MM, this holds if and only if MM halts.

So M↦(R,C,Q0,qf)M \mapsto (R, C, Q_0, q_f) is a computable map from machines to instances, and MM halts on the empty tape if and only if Q0Q_0 is unsafe for qfq_f. It is a many-one reduction from the halting problem to unsafety. If SAFETY were decidable, so would be unsafety, and so the halting problem. Hence SAFETY is undecidable.

Unsafety is recursively enumerable. Enumerate the finite sequences of calls. At each step there are finitely many commands, and each parameter is an existing object or a new name; up to renaming of new names, there are finitely many choices. Run each sequence and check whether some call enters rr into a cell without rr. If Q0Q_0 is unsafe, this search stops. A set and its complement that are both recursively enumerable are decidable, so the safe instances are not recursively enumerable. ■\blacksquare

Example of one move. Take the tape WXYZWXYZ with the head on cell 2 in state qq, as in Figure 3 of the paper. The matrix has A[s1,s1]={W}A[s_1, s_1] = \{W\}, A[s2,s2]={X,q}A[s_2, s_2] = \{X, q\}, A[s3,s3]={Y}A[s_3, s_3] = \{Y\}, A[s4,s4]={Z,end}A[s_4, s_4] = \{Z, end\} and ownown in A[s1,s2]A[s_1, s_2], A[s2,s3]A[s_2, s_3] and A[s3,s4]A[s_3, s_4]. If δ(q,X)=(p,V,L)\delta(q, X) = (p, V, L), only the call CqX(s1,s2)C_{qX}(s_1, s_2) has a true condition and changes the matrix. After it, A[s1,s1]={W,p}A[s_1, s_1] = \{W, p\} and A[s2,s2]={V}A[s_2, s_2] = \{V\}: the tape is WVYZWVYZ with the head on cell 1 in state pp.

Consequences

  • No general analysis tool. A tool that checks arbitrary access control configurations for leaks must give up exactness: it can work on a restricted class, bound the search, or answer "unknown". This is why later models restrict the commands, as Take-Grant does, or fix the rules, as Bell-LaPadula does.
  • One fixed system. HRU strengthen the theorem with a universal Turing machine: there is one protection system, fixed once, for which safety is undecidable as a function of the initial configuration. So the hardness is not only in the choice of commands.
  • Relation to Rice's theorem. The proof has the same shape as the proof of Rice's theorem: a semantic question about all runs of a system is reduced to halting. It is not an instance of Rice's theorem, because safety is a property of a protection system and a configuration, not of the language of a Turing machine.
  • The second version. If the question is whether rr can reach one given cell, the problem is also undecidable. The map from this version to the first in the HRU paper is not a reduction; Tripunitara and Li (2013) gave a correct one.

Tightness

The theorem cannot be extended to every restricted class, and the borders are known for several classes. All items are theorems.

  • One operation per command. For mono-operational systems, safety is decidable: a shortest leaking sequence has at most g(∣S0∣+1)(∣O0∣+1)+1g(|S_0| + 1)(|O_0| + 1) + 1 calls, where g=∣R∣g = |R|. With the commands in the input, the problem is NP-complete; hardness is by a reduction from the clique problem. The proof of membership in NP in the 1976 paper assumed that these systems are monotonic for safety, which is false; Tripunitara and Li (2013) gave a corrected proof.
  • No creates. Without create operations, the set of configurations is finite, and safety is PSPACE-complete (HRU, Theorem 3).
  • Monotonic systems. Removing delete and destroy is not enough. Harrison and Ruzzo (1978) showed that safety stays undecidable for monotonic systems, even when each condition has at most two tests. With at most one test per condition and no delete or destroy, safety is decidable.
  • The proof needs create. The commands DqXD_{qX} create a subject for each new tape cell. This is necessary for undecidability, because without creates the problem is in PSPACE.

History

Harrison, Ruzzo and Ullman presented the model and the theorem at a conference in 1975 and in Communications of the ACM in 1976. The paper gave the first precise statement of the safety question for an access matrix with commands, and it gave the undecidable case, the decidable mono-operational case and the PSPACE-complete case without creates. Harrison and Ruzzo studied monotonic systems in 1978. In 2013 Tripunitara and Li reexamined the paper, found the error in the NP membership proof and in the map between the two versions of safety, and repaired both.

References

  1. Michael A. Harrison, Walter L. Ruzzo and Jeffrey D. Ullman, Protection in operating systems, Communications of the ACM 19(8), 1976, pages 461 to 471, Section 4 (the definition of safety, Theorem 1 and its NP-completeness), Section 5 (Theorem 2, the simulation of a Turing machine, Figures 3 and 4, and Theorem 3)
  2. Mahesh V. Tripunitara and Ninghui Li, The foundational work of Harrison-Ruzzo-Ullman revisited, IEEE Transactions on Dependable and Secure Computing 10(1), 2013, pages 28 to 39, the error in the NP membership proof for mono-operational systems, the corrected proof, and the new reduction for the second version of safety
  3. Michael A. Harrison and Walter L. Ruzzo, Monotonic protection systems, in R. A. DeMillo, D. P. Dobkin, A. K. Jones and R. J. Lipton (editors), Foundations of Secure Computation, Academic Press, 1978, undecidability for monotonic biconditional systems and decidability for monotonic monoconditional systems
  4. Matt Bishop, Computer Security: Art and Science, second edition, Addison-Wesley, 2018, Chapter 3, Foundational Results

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