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

Similar vulnerable functions related to CVE-2017-14041 #1044

Closed
YangY-Xiao opened this issue Dec 8, 2017 · 2 comments
Closed

Similar vulnerable functions related to CVE-2017-14041 #1044

YangY-Xiao opened this issue Dec 8, 2017 · 2 comments

Comments

@YangY-Xiao
Copy link

There are two functions similar to vulnerable function with id CVE-2017-14041 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14041 with issue id (#997 ).

Below is the patch for CVE-2017-14041.
e528531
default

Below are two functions that similar to the vulnerable function.

  1. src/bin/jp3d/convert.c (pgxtovolume)
    for (s = 0; s < sliceno; s++) {
        int pos = maxslice == sliceno ? s : pgxslicepos[s];
        f = fopen(pgxfiles[pos], "rb");
        if (!f) {
            fprintf(stdout, "[ERROR] Failed to open %s for reading !\n", pgxfiles[s]);
            return NULL;
        }    
        fprintf(stdout, "[INFO] Loading %s \n", pgxfiles[pos]);

        fseek(f, 0, SEEK_SET);
        fscanf(f, "PG%[ \t]%c%c%[ \t+-]%d%[ \t]%d%[ \t]%d", temp, &endian1, &endian2,
               signtmp, &prec, temp, &w, temp, &h); 

        i = 0; 
        sign = '+'; 
        while (signtmp[i] != '\0') {
            if (signtmp[i] == '-') {
                sign = '-'; 
            }    
            i++; 
        }

default

  1. src/bin/jpwl/convert.c (pgxtoimage)
    fseek(f, 0, SEEK_SET);
    if (fscanf(f, "PG%[ \t]%c%c%[ \t+-]%d%[ \t]%d%[ \t]%d", temp, &endian1,
               &endian2, signtmp, &prec, temp, &w, temp, &h) != 9) { 
        fprintf(stderr,
                "ERROR: Failed to read the right number of element from the fscanf() function!\n");
        fclose(f);
        return NULL;
    }

default

I think there are vulnerabilities in those two functions, too. Therefore, there should be patches for those two functions.

hlef added a commit to hlef/openjpeg that referenced this issue Oct 22, 2018
Missing buffer length formatter in fscanf call might lead write stack
overflow.

fixes uclouvain#1044 (CVE-2017-17480)
hlef added a commit to hlef/openjpeg that referenced this issue Oct 22, 2018
Missing buffer length formatter in fscanf call might lead to write
stack buffer overflow.

fixes uclouvain#1044 (CVE-2017-17480)
@hlef
Copy link
Contributor

hlef commented Oct 22, 2018

Assigned CVE-2017-17480. I have submitted a PR addressing this issue.

hlef added a commit to hlef/openjpeg that referenced this issue Nov 1, 2018
Missing buffer length formatter in fscanf call might lead to write
stack buffer overflow.

fixes uclouvain#1044 (CVE-2017-17480)
@eslerm
Copy link

eslerm commented Sep 16, 2022

Vulnerability in pgxtoimage function was assigned CVE-2017-17479.

Vulnerability in pgxtovolume function was assigned CVE-2017-17480.

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

3 participants