Bug 1720269

Summary: osin: side channel timing attack against endpoint secrets
Product: OpenShift Container Platform Reporter: Dave Baker <dbaker>
Component: apiserver-authAssignee: Standa Laznicka <slaznick>
Status: CLOSED ERRATA QA Contact: pmali
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aos-bugs, nagrawal, scheng, sttts, xxia
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:11:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Baker 2019-06-13 14:25:23 UTC
Description of problem:

osin compares secrets for endpoints secured by client secret auth with native string comparison.  This is done in linear time, which opens the possibility of a side-channel timing attack.


Version-Release number of selected component (if applicable):

Present in current master branch of "osin"

https://github.com/openshift/osin


How reproducible:

This is believed to be a hardening bug, not a vulnerability.

We do not have current information on the reliability of attacking via this timing side-channel.



Steps to Reproduce:
1. https://en.wikipedia.org/wiki/Timing_attack
2.
3.

Actual results:



Expected results:

String comparisons should take constant time.



Additional info:

Native string comparison is here:
- https://github.com/openshift/osin/blob/master/util.go#L31

Golang crypto library offers this as an alternative:
- https://golang.org/pkg/crypto/subtle/#ConstantTimeCompare

Comment 11 errata-xmlrpc 2020-07-13 17:11:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2409