[UBUNTU 21.04] openCryptoki: Soft token does not check if an EC key is valid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on IBM z Systems |
Fix Released
|
High
|
Skipper Bug Screeners | ||
opencryptoki (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Description]
The Opencryptoki Soft token does not check if an EC key is valid when an EC key is created via C_CreateObject, nor when C_DeriveKey is used with ECDH public data. This may allow one to perform Invalid Curve Attacks.
Fix:
https:/
This commit should apply smooth on top of OCK 3.16.0, but also on OCK 3.15.0 or 3.15.1.
EC support has been introduced in the Soft token with OCK 3.15.0. So all OCK versions >= 3.15.0 are affected. Earlier OCK releases are not affected.
This problem need only to be fixed with 21.04 wherer 3.15.1 is included.
[Test Plan]
DO THIS IN A THROWAWAY VM!!! The cleanup routine in the test isn't itself
well tested :)
First step is to prepare the default software-based slot for the tests.
We'll setup the user password to be 1234 (hardcoded in the testfile).
We're assuming the opencryptoki configuration is the default one (i.e. software-based backend at slot 3), in which case the SO password is by default 87654321
$ sudo apt install opencryptoki
$ sudo pkcsconf -c 3 -u
When this is done, install the lib headers (libopencryptok
$ gcc test.c -o sru-test -lopencryptoki
Finally, run the binary as root. The return code will be 0 if the incorrect key is rejected, 56 if not.
$ sudo ./sru-test
[Where problems could occur]
Even assuming the underlying code is perfectly correct, the update increases the API surface of the library slightly, which could provoke namespace clashes where none existed before.
If the EC checking code isn't correct, the soft token implementation might reject some valid keys that would have previously gone through.
CVE References
tags: | added: architecture-s39064 bugnameltc-192742 severity-high targetmilestone-inin2104 |
Changed in ubuntu: | |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
affects: | ubuntu → opencryptoki (Ubuntu) |
Changed in ubuntu-z-systems: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
Changed in opencryptoki (Ubuntu Impish): | |
assignee: | Skipper Bug Screeners (skipper-screen-team) → nobody |
tags: | added: fr-1388 |
Changed in ubuntu-z-systems: | |
status: | Triaged → In Progress |
description: | updated |
Changed in ubuntu-z-systems: | |
status: | In Progress → Fix Released |
------- Comment From <email address hidden> 2021-05-19 02:22 EDT-------
Also to be added to 3.16 (impish) . I missed that.