Skip to content

Commit 6038150

Browse files
authored
Merge pull request #85 from JabRef/add-cve-links
Fix markdown
2 parents be60046 + 84b8cf4 commit 6038150

File tree

2 files changed

+63
-56
lines changed

2 files changed

+63
-56
lines changed

LICENSE.EAST301 renamed to LICENSE

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
Copyright (c) 2012, east301
2+
Copyright (c) 2016-2023, Rex Hoffman and contributors
3+
24
All rights reserved.
35

46
Redistribution and use in source and binary forms, with or without
57
modification, are permitted provided that the following conditions are met:
6-
* Redistributions of source code must retain the above copyright
7-
notice, this list of conditions and the following disclaimer.
8-
* Redistributions in binary form must reproduce the above copyright
9-
notice, this list of conditions and the following disclaimer in the
10-
documentation and/or other materials provided with the distribution.
11-
* Neither the name of the east301 nor the
12-
names of its contributors may be used to endorse or promote products
13-
derived from this software without specific prior written permission.
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of east301 nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
1419

1520
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1621
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -21,4 +26,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2126
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2227
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2328
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,68 @@
1-
## Status ##
1+
## Status
22

33
[![Build Status](https://github.com/javakeyring/java-keyring/actions/workflows/ci.yml/badge.svg)](https://github.com/javakeyring/java-keyring/actions/workflows/ci.yml)
44
[![Maven Site](https://img.shields.io/badge/maven_site-1.0.1-green.svg)](https://javakeyring.github.io/java-keyring/1.0.1/)
55
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.javakeyring/java-keyring/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.javakeyring/java-keyring)
66
[![codebeat badge](https://codebeat.co/badges/ebdaafc6-987c-41bd-8902-e277334aac30)](https://codebeat.co/projects/github-com-javakeyring-java-keyring-master)
77
[![codecov](https://codecov.io/gh/javakeyring/java-keyring/branch/master/graph/badge.svg)](https://codecov.io/gh/javakeyring/java-keyring)
88

9-
## Summary ##
9+
## Summary
1010

1111
<img align="left" width="180" height="180" src="./src/site/resources/javakeyring.png">
1212

13-
java-keyring is a small library which provides a simple java API to store passwords and secrets __insecurely__ in native os keystores.
13+
java-keyring is a small library which provides a simple java API to store passwords and secrets __insecurely__ in native OS keystores.
1414

15-
Currently Mac OS X, Windows and Linux (GNOME or KDE) are supported.
15+
Currently, Mac OS X, Windows and Linux (GNOME or KDE) are supported.
1616

17-
## History ##
17+
## History
1818

1919
Initially an abandoned bitbucket repo, but lotsa love has been given to it.
20-
* Proper windows credential store access.
21-
* Delete support.
22-
* Solid testing.
23-
* Automated builds in all target environments, though KWallet needs seeded with an existing wallet.
20+
21+
* Proper windows credential store access.
22+
* Delete support.
23+
* Solid testing.
24+
* Automated builds in all target environments, though KWallet needs seeded with an existing wallet.
2425

2526
Initial repo: [https://bitbucket.org/east301/java-keyring](https://bitbucket.org/east301/java-keyring)
2627

2728
Cloned from: [https://bitbucket.org/bpsnervepoint/java-keyring](https://bitbucket.org/bpsnervepoint/java-keyring)
2829

29-
## Security Issues ##
30+
## Security Concerns
3031

31-
CVE-2018-19358 (Vulnerability)
32+
[CVE-2018-19358](https://www.cve.org/CVERecord?id=CVE-2018-19358) (Vulnerability)
3233

33-
There is a current investigation on the behaviour of the Secret Service API, as other applications can easily read any secret, if the keyring is unlocked (if a user is logged in, then the login/default collection is unlocked). Available D-Bus protection mechanisms (involving the busconfig and policy XML elements) are not used by default. The Secret Service API was never designed with a secure retrival mechanism.
34+
On GNOME, after the key ring is unlocked, all applications of the current user can access the passwords.
35+
According to [Debian's evaluation](https://security-tracker.debian.org/tracker/CVE-2018-19358), this is a non-issue.
36+
Workaround: Users can use separate key rings.
3437

35-
* CVE-2018-19358 Base Score: __[7.8 HIGH]__, CVSS:3.0
36-
* GNOME Keyring Secret Service API Login Credentials Retrieval Vulnerability Base Score: __[5.5 Medium]__, CVSS:3.0
38+
Please keep in mind the above is not only about GNOME. Windows credentials [can be recovered easily](https://security.stackexchange.com/a/63909/37275).
3739

38-
## Public Service Announcement ##
40+
Both Mac OS X and Windows will ask the runtime to allow the __Java runtime__ to connect to the key ring. This is an issue in case applications share the Java runtime: All of these applications can access the passwords stored in the key ring. This should be considered a vulnerability, as all java apps will be allowed access. I personally wouldn't store any credentials in the system keyring, ever, and especially on a system allowing any java application access.
3941

40-
Please keep in mind the above isn't only about gnome/secret service. Both os-x and window will ask the runtime to allow __java__ to connect to the key ring. This should be considered a vunlrability, as all java apps will be allowed access. I personally wouldn't store any credentials in the system keyring, ever, and especially on a system allowing any java app access.
42+
That said, I would be comfortable storing in plain text. For example, passwords you may be forced to store in `~/.m2/settings.xml` are development databases credentials, etc.). For any of the things a developer usually has to store in plain text because there is no better option would be fine to store in the key ring. At least you can look them up in all your tests/apps in a single location if you are consistent with your service/user naming. Hopefully, these developing services are not available to the internet, you VPN into them, right? They may have attack vectors as well. [strongSwan](https://www.strongswan.org/) is pretty easy to set up.
4143

42-
That said, anything I would be comfortable storing in plain text would be fine. For example, passwords you may be forced to store in ~/.m2/settings.xml, developement databases creds, etc) or any of the things a developer usually has to store in plain text because there is no better option would be fine to store in the keyring. At least you can look them up in all your tests/apps in a single location if you are consistent with your service/user naming. Hopefully these dev services are not available to the internet, you vpn in to them, right? They may have attack vectors as well. StrongSwan is pretty easy to set up.
44+
Use a real password manager for your real secrets. Something like [KeePassXC](https://keepassxc.org/), [Bitwarden](https://bitwarden.com/), Enpass, 1Password, etc. Keep that password manager locked - make sure it is setup to autolock after you login to something with it. Use a secondary factor if you can with important services, particularly financial, and e-mail, and if you're in to that sort of thing, social sites - like github.com.
4345

44-
Use a real password manager for your real secrets. Something like Keypass, Enpass, 1Password, Bitwarden, etc. Keep that password manager locked - make sure it's setup to autolock after you login to something with it. Use a secondary factor if you can with important services, particularly financial, and e-mail, and if you're in to that sort of thing, social sites - like github.com.
46+
## Implementation
4547

46-
## Implementation ##
48+
### Mac OS X
4749

48-
__Mac OS X__
49-
* Passwords are stored using [OS X Keychain](https://support.apple.com/guide/keychain-access/welcome/mac) using [Keychain Services](https://developer.apple.com/documentation/security/keychain_services/keychain_items). This is done either via built-in JNA bindings for the legacy API, or [jkeychain](https://github.com/davidafsilva/jkeychain).
50+
* Passwords are stored using [OS X Keychain](https://support.apple.com/guide/keychain-access/welcome/mac) using [Keychain Services](https://developer.apple.com/documentation/security/keychain_services/keychain_items). This is done either via built-in [JNA](https://github.com/twall/jna) bindings for the legacy API, or [jkeychain](https://github.com/davidafsilva/jkeychain).
5051

51-
__Linux/Freedesktop__
52-
* Passwords are stored using either [DBus Secret Service](https://specifications.freedesktop.org/secret-service/) (you've probably used [Seahorse](https://en.wikipedia.org/wiki/Seahorse_(software))) via the excellent [secret-service](https://github.com/swiesend/secret-service) library, or KWallet under KDE.
52+
### Linux/Freedesktop
53+
54+
* Passwords are stored using either [DBus Secret Service](https://specifications.freedesktop.org/secret-service/) (you've probably used [Seahorse](https://en.wikipedia.org/wiki/Seahorse_(software))) via the excellent [secret-service](https://github.com/swiesend/secret-service) library, or [KWallet](https://apps.kde.org/de/kwalletmanager5/) under KDE.
55+
56+
### Windows
57+
58+
* Passwords are stored using [Credential Manager](https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager), exceptions will contain [Error Codes](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes). Access is via the [Wincred](https://docs.microsoft.com/en-us/windows/win32/api/wincred/) API.
59+
* Windows seems prone to race conditions where reads/writes may not be immediately visible.
5360

54-
__Windows__
55-
* Passwords are stored using [Credential Manager](https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager), exceptions will contain [Error Codes](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes). Access is via the [Wincred](https://docs.microsoft.com/en-us/windows/win32/api/wincred/) api.
56-
Windows seems prone to race conditions where reads/writes may not be immediately visible.
61+
## Usage
5762

58-
## Usage ##
63+
The library is available at Maven central: <https://central.sonatype.com/artifact/com.github.javakeyring/java-keyring>.
5964

60-
Dirt simple:
65+
The most simple usage is as follows:
6166

6267
```java
6368
try (Keyring keyring = Keyring.create()) {
@@ -67,7 +72,7 @@ Dirt simple:
6772
}
6873
```
6974

70-
Recommend creating a dummy value if getPassword() fails, so that users know where to go set the value in their applications.
75+
Recommend creating a dummy value if `getPassword()` fails, so that users know where to go set the value in their applications.
7176

7277
```java
7378
try (final Keyring keyring = Keyring.create()) {
@@ -85,36 +90,33 @@ Recommend creating a dummy value if getPassword() fails, so that users know wher
8590
}
8691
```
8792

88-
## Building ##
93+
## Building
8994

9095
```bash
9196
mvn clean install -Dgpg.skip=true
9297
```
9398

94-
## License ##
99+
## License
95100

96-
Source code of java-keyring is available under a BSD license.
97-
See the file LICENSE.EAST301 for more details.
101+
Source code of java-keyring is available under a BSD license.
102+
See the file [`LICENSE`](LICENSE) for more details.
98103

99-
## PRs are Welcome ##
104+
## PRs are Welcome
100105

101106
Outstanding work:
102107

103-
* Windows error message conversion.
104-
* Windows has no locking/session mechanism allowing for races between threads (like the maven tests in this project).
105-
* Provide easy binding for Spring / CDI / etc.
106-
* Support for build tools like Maven/Gradle.
107-
* Perhaps optional UI requests for passwords (Wincred/secret-service have Apis at least to prompt users).
108-
* Convert to Kotlin and test in different Kotlin build target (node/jvm/binary).
108+
* Windows error message conversion.
109+
* Windows has no locking/session mechanism allowing for races between threads (like the maven tests in this project).
110+
* Provide easy binding for Spring / CDI / etc.
111+
* Perhaps optional UI requests for passwords (Wincred/secret-service have APIs at least to prompt users).
112+
* Convert to Kotlin and test in different Kotlin build target (node/jvm/binary).
109113

110114
That said, this library is perfectly usable today and tested on all systems. Checkout the badges above!
111115

112-
## Special Thanks ##
116+
## Special Thanks
113117

114-
java-keyring uses the following library, thanks a lot!
115-
java-keyring package contains copy of compiled JNA library.
116-
Source code of the library is available at its project page.
118+
java-keyring uses the following libraries, thanks a lot!
117119

118-
* [Java native access (JNA)](https://github.com/twall/jna)
119-
* [Secret Service](https://github.com/swiesend/secret-service)
120-
* [jkeychain](https://github.com/davidafsilva/jkeychain)
120+
* [Java native access (JNA)](https://github.com/twall/jna)
121+
* [Secret Service](https://github.com/swiesend/secret-service)
122+
* [jkeychain](https://github.com/davidafsilva/jkeychain)

0 commit comments

Comments
 (0)