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

Veracode Scan of the app results into "377:Insecure Temporary File" #644

Open
MGohil opened this issue Sep 13, 2024 · 6 comments
Open

Veracode Scan of the app results into "377:Insecure Temporary File" #644

MGohil opened this issue Sep 13, 2024 · 6 comments

Comments

@MGohil
Copy link

MGohil commented Sep 13, 2024

When we scan the app through Veracode to check for any static code vulnerabilities, it gives the "Insecure Temporary File".
Following is detail and also provides remedies on how to fix this.

image

This error points to BitmapUtils.kt Line 461 at:

Which is main reason of this issue reported by Veracode static screen.

I am not using this library directly into any native app, but using it into .NET Maui app via one of the Binding Library which originally uses this native Android library.

I have reported similar issue there too: jmbowman1107/ImageCropper.Maui#28 but even after updating to 4.6.0 didn't resolve it.

Would you please have a look and fix this please, so we can update to latest .aar and build our .NET Maui supported binary?

Thanks,
Milan G

@MGohil
Copy link
Author

MGohil commented Sep 17, 2024

@vanniktech @Canato

I would appreciate if someone can look into this issue please? Fixing this issue is required to get our app into production.
Please let me know in case you need any more details.

Thanks.

@vanniktech
Copy link
Contributor

Happy to take a PR that fixes this behavior. I'm not even sure this function is actually used in your case.

@MGohil
Copy link
Author

MGohil commented Sep 17, 2024

@vanniktech Thanks for your response, unfortunately, it will be difficult for me to fix this and raise PR as I am not a Kotlin guy. Will it be possible for you to try removing this last parameter from below method and keeping first two?

val file = File.createTempFile(
            "cropped",
            ext,
            context.getExternalFilesDir(Environment.DIRECTORY_PICTURES),
          )

I am not sure what will affect if we remove this last parameter, but the solution to above issue tells us to use createTempFile method which has only 2 parameters.

--OR--

If we want to use 3 argument version of this method, then we have to pass SANBOXED path in 3rd argument in this method. I am bit not sure as of now on this what path to pass here.

@vanniktech
Copy link
Contributor

It might. I also don't know how this method is used currently. I took the library over and haven't had time yet to unravel all of those nested Utils calls.

If we want to use 3 argument version of this method, then we have to pass SANBOXED path in 3rd argument in this method. I am bit not sure as of now on this what path to pass here.

If that's supported by Android it might be the best option.

@MGohil
Copy link
Author

MGohil commented Oct 8, 2024

@vanniktech

Just checking if is there any progress on this? May we get the above fix soon? Would you please let me know about your plan on this?

This is very crucial for our app to fix this security issue raised by Veracode scanning.

Thanks,
Milan G.

@vanniktech
Copy link
Contributor

Look, this project is open source. I have no obligations and neither does any other open source author. You're free to use this library as is or not. I have no plans about this. My priorities are currently elsewhere. If it is so urgent to you, you could fix it yourself and raise a PR that fixes this in a way it's not breaking anyone else and everyone could benefit from the fix.

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

2 participants