Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information flow missing data #37

Open
trombonehero opened this issue Aug 9, 2015 · 1 comment
Open

Information flow missing data #37

trombonehero opened this issue Aug 9, 2015 · 1 comment

Comments

@trombonehero
Copy link
Member

In the linked test program, there is a private data access in f(), which propagates the data to its caller e(), and from there up to main(). Then main() calls a(), which calls b(), etc. Data accesses in c() and d() should be allowed, since c() is annotated as an ephemeral "mysandbox" sandbox.

So, I expected SOAAP to report the following data flow:

f -> e -> main -> a -> b

In the SOAAP-generated JSON file, however, there are no such traces. I do get some correct information about the private accesses in a, b, f and main: in all four cases, the data source is correctly shown as line 10 (which is in f()). However, there is no trace showing how the data propagates from f() to b(), and there is no indication at all of a private data access in e(). Now, there might be a valid argument that e() doesn’t “access” the private data, but it is definitely involved in conducting the data along the path to main(), a() and b().

@trombonehero
Copy link
Member Author

For posterity, the test program was:

#include "soaap.h"

class Foo {
    public:
    int x __soaap_private("mysandbox");
};

int f() {
    Foo f;
    return f.x;
}

int e() {
    return f();
}

__soaap_vuln_fn("CVE xxx-yyyy-00001")
void d(int i) {
}

__soaap_sandbox_ephemeral("mysandbox")
void c(int i) {
      d(i);
}

void b(int i) {
      c(i);
}

__soaap_vuln_fn("CVE xxx-yyyy-00002")
void a(int i) {
      b(i);
}

int main(int arg, char** argv) {
    int x = e();
    a(x);
    return 0;
}

and SOAAP generated the following JSON:

{
  "soaap": {
    "vulnerability_warning": [
      {
        "function": "d(int)",
        "sandbox": "mysandbox",
        "location": {
          "file": "test.cc",
          "line": 18
        },
        "type": "cve",
        "cve": [
          {
            "id": "CVE xxx-yyyy-00001"
          }
        ],
        "restricted_rights": "true",
        "rights_leaked": {
          "private": [
            {
              "type": "struct_member",
              "name": "f"
            }
          ]
        },
        "trace_ref": "!trace0"
      },
      {
        "function": "a(int)",
        "sandbox": null,
        "location": {
          "file": "test.cc",
          "line": 31
        },
        "restricted_rights": false,
        "type": "cve",
        "cve": [
          {
            "id": "CVE xxx-yyyy-00002"
          }
        ],
        "trace_ref": "!trace1"
      }
    ],
    "global_access_warning": [
    ],
    "global_lost_update": [
    ],
    "syscall_warning": [
    ],
    "cap_rights_warning": [
    ],
    "privileged_call": [
    ],
    "sandboxed_func": [
    ],
    "access_origin_warning": [
    ],
    "classified_warning": [
    ],
    "private_access": [
      {
        "function": "main",
        "sandbox_private": [
          {
            "name": "mysandbox"
          }
        ],
        "sources": [
          {
            "location": {
              "line": 10,
              "file": "test.cc"
            }
          }
        ],
        "location": {
          "line": 37,
          "file": "test.cc"
        }
      },
      {
        "function": "f()",
        "sandbox_private": [
          {
            "name": "mysandbox"
          }
        ],
        "sources": [
          {
            "location": {
              "line": 10,
              "file": "test.cc"
            }
          }
        ],
        "location": {
          "line": 10,
          "file": "test.cc"
        }
      },
      {
        "function": "a(int)",
        "sandbox_private": [
          {
            "name": "mysandbox"
          }
        ],
        "sources": [
          {
            "location": {
              "line": 10,
              "file": "test.cc"
            }
          }
        ],
        "location": {
          "line": 32,
          "file": "test.cc"
        }
      },
      {
        "function": "b(int)",
        "sandbox_private": [
          {
            "name": "mysandbox"
          }
        ],
        "sources": [
          {
            "location": {
              "line": 10,
              "file": "test.cc"
            }
          }
        ],
        "location": {
          "line": 27,
          "file": "test.cc"
        }
      }
    ],
    "private_leak": [
    ],
    "!trace0": {
      "name": "!trace0",
      "trace": [
        {
          "function": "c(int)",
          "location": {
            "file": "test.cc",
            "line": 23
          }
        },
        {
          "function": "b(int)",
          "location": {
            "file": "test.cc",
            "line": 27
          }
        },
        {
          "function": "a(int)",
          "location": {
            "file": "test.cc",
            "line": 32
          }
        },
        {
          "trace_ref": "!trace1"
        }
      ]
    },
    "!trace1": {
      "name": "!trace1",
      "trace": [
        {
          "function": "main",
          "location": {
            "file": "test.cc",
            "line": 37
          }
        }
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant