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

when try to scan a directory, it seems that only one file is scanned, is it a bug? #103

Open
HTQianqian opened this issue Oct 31, 2020 · 3 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@HTQianqian
Copy link

codyze vision: 1.4.1

scanning folder: [install dir]\bin\codyze.bat -c -s [folder] -m [install dir]\mark

scanning file: [install dir]\bin\codyze.bat -c -s [folder\RSAPadding.java] -m [install dir]\mark

In the folder, there are many java files. but I only get the result findbug.json with file RSAPadding.java.it seems that only one file is scanned when try to scan a directory.

@fwendland
Copy link
Collaborator

Hi HTQianqian,

sorry to hear that you're having problems. I'll take a look at a sample project of mine.

@fwendland fwendland self-assigned this Nov 2, 2020
@fwendland fwendland added bug Something isn't working help wanted Extra attention is needed question Further information is requested and removed bug Something isn't working labels Nov 2, 2020
@fwendland
Copy link
Collaborator

fwendland commented Nov 2, 2020

Hi @HTQianqian,

I've tested Codyze 1.4.1 on my Windows machine with the botan_rule_tr_test in the src/test/resources folder. It worked fine. I've got a findings.json with multiple findings across multiple files.

Maybe your project contains findings only in RSAPadding.java? Is your project code by any chance open source so I can try it?

@HTQianqian
Copy link
Author

HTQianqian commented Nov 4, 2020

@fwendland, Thanks for you feedback ,here is my test code and command

The command:
codyze-1.4.1\bin\codyze.bat -c --source InadequateRSAPadding

The structure of my folder:
InadequateRSAPadding
--CWE780_WeakEncryption_InadequateRSAPadding_31
----CWE780_WeakEncryption_InadequateRSAPadding_31a.java
----CWE780_WeakEncryption_InadequateRSAPadding_31b.java
--CWE780_WeakEncryption_InadequateRSAPadding_01.java

------------------------------------CWE780_WeakEncryption_InadequateRSAPadding_01.java: -------------------------------------

package WeakEncryption.InadequateRSAPadding;

import javax.crypto.Cipher;

public class CWE780_WeakEncryption_InadequateRSAPadding_01 {
    public void bad() throws Exception {
        /* POTENTIAL FLAW: Not OAEP */
        Cipher.getInstance("RSA");
    }

    public void good() throws Exception {
        Cipher.getInstance("RSA/ECB/OAEPWithSHA-512AndMGF1Padding");
    }
}

--------------------------------------CWE780_WeakEncryption_InadequateRSAPadding_31a.java-------------------------------------

package WeakEncryption.InadequateRSAPadding;

import javax.crypto.Cipher;

public class CWE780_WeakEncryption_InadequateRSAPadding_31a {
    public Cipher getInstanceBad(String transformation) throws Exception {
        /* POTENTIAL FLAW: NOT OAEP */
        return Cipher.getInstance(transformation);
    }

    public Cipher getInstanceGood(String transformation) throws Exception {
        return Cipher.getInstance(transformation);
    }
}

-------------------------------------CWE780_WeakEncryption_InadequateRSAPadding_31b.java-------------------------------------

package WeakEncryption.InadequateRSAPadding;

public class CWE780_WeakEncryption_InadequateRSAPadding_31b {
    public void bad() throws Exception {
        CWE780_WeakEncryption_InadequateRSAPadding_31a inadequateRSAPadding_31a =
                new CWE780_WeakEncryption_InadequateRSAPadding_31a();

        inadequateRSAPadding_31a.getInstanceBad("RSA");
    }

    public void good() throws Exception {
        CWE780_WeakEncryption_InadequateRSAPadding_31a inadequateRSAPadding_31a =
                new CWE780_WeakEncryption_InadequateRSAPadding_31a();

        inadequateRSAPadding_31a.getInstanceGood("RSA/ECB/OAEPWithSHA-512AndMGF1Padding");
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants