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

security is broken when temporary private key file won't get deleted if exception thrown #73

Closed
jimengliu opened this issue Jun 15, 2018 · 10 comments

Comments

@jimengliu
Copy link

jimengliu commented Jun 15, 2018

After using jcabi-ssh for a while, I noticed a lot of private key files inside /tmp folder. This poses significant security issues.

The problem is in session() function (in file src/main/java/com/jcabi/ssh/Ssh.java). The temporary private key file was constructed first, but it won't get deleted when there is exception thrown. Because the line to delete the file

Files.deleteIfExists(file.toPath());

is within try{} block, not in finally{} block.

@0crat
Copy link

0crat commented Jun 15, 2018

@yegor256/z please, pay attention to this issue

@0crat
Copy link

0crat commented Jun 15, 2018

@jimengliu/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

yegor256 added a commit that referenced this issue Jun 15, 2018
@yegor256
Copy link
Member

@rultor release, tag is 1.6.1

@rultor
Copy link
Contributor

rultor commented Jun 15, 2018

@rultor release, tag is 1.6.1

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Jun 15, 2018

@rultor release, tag is 1.6.1

@yegor256 Done! FYI, the full log is here (took me 19min)

@yegor256
Copy link
Member

@jimengliu fixed and release in 1.6.1. Thanks!

@0crat
Copy link

0crat commented Jun 15, 2018

Job gh:jcabi/jcabi-ssh#73 is not assigned, can't get performer

@0crat
Copy link

0crat commented Jun 15, 2018

The job is not in WBS, won't close the order

@jimengliu
Copy link
Author

Thanks @yegor256 for quick fix on this! When do you release the jcabi-ssh.jar on maven central(https://mvnrepository.com/artifact/com.jcabi/jcabi-ssh) where we downloaded officially ?

@jimengliu
Copy link
Author

@yegor256 Oh, I do see here http://central.maven.org/maven2/com/jcabi/jcabi-ssh/1.6.1/, but no link from https://mvnrepository.com. So, I am OK now. Thanks!

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

4 participants