Open trombonehero opened 9 years ago
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
}
}
]
}
}
}
In the linked test program, there is a private data access in
f()
, which propagates the data to its callere()
, and from there up tomain()
. Thenmain()
callsa()
, which callsb()
, etc. Data accesses inc()
andd()
should be allowed, sincec()
is annotated as an ephemeral"mysandbox"
sandbox.So, I expected SOAAP to report the following data flow:
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
andmain
: in all four cases, the data source is correctly shown as line 10 (which is inf()
). However, there is no trace showing how the data propagates fromf()
tob()
, and there is no indication at all of a private data access ine()
. Now, there might be a valid argument thate()
doesn’t “access” the private data, but it is definitely involved in conducting the data along the path tomain()
,a()
andb()
.