Skip to content

Security Issues #1

@qingkaishi

Description

@qingkaishi

Dear friends,

Your paper on Graspan leaves us a deep impression. It is definitely a good work that opens up a new direction.

Here, we found two security issues in your code and, perhaps, it can help improve.

The first one is at https://github.com/Graspan/graspan-cpp/blob/master/src/preproc/preproc.cpp#L60

The code is like:

while (fscanf(fp, "%d\t%d\t%s\n", &src, &dst, ctemp) != EOF) {
label += ctemp;
data[src].push_back(std::make_pair(dst, label)); // <-- "src" is from an external file that may cause a buffer-overflow vulnerability. It is better to put a sanity check on "src" here.
dataCheck[dst] = 1;
dataCheck[src] = 1;
count++;
label = "";
}

The second is similar and is here: https://github.com/Graspan/graspan-cpp/blob/master/src/preproc/preproc_new.cpp#L56

while (fscanf(fp, "%d\t%d\t%s\n", &src, &dst, ctemp) != EOF) {
dataCount[src]++; // <-- "src" is from an external file, It is better to put a sanity check on "src" here.
count++;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions