RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1273271 - klist/kdestroy is hiding active credential cache
Summary: klist/kdestroy is hiding active credential cache
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: krb5
Version: 7.2
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: ---
Assignee: Matt Rogers
QA Contact: Patrik Kis
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-20 06:31 UTC by Martin Kosek
Modified: 2017-08-01 17:58 UTC (History)
4 users (show)

Fixed In Version: krb5-1.15.1-1.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-08-01 17:58:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1891 0 normal SHIPPED_LIVE krb5 bug fix and enhancement update 2017-08-01 18:04:38 UTC

Description Martin Kosek 2015-10-20 06:31:38 UTC
Description of problem:
When using collection type of cache (like DIR or keyring) and kinit is done when having an active credentials cache, the old cache is not overwritten, but rather a new one is initiated.

Then, both active caches can be used for authentication. This is intended behavior and works well when "-A" option of klist/kdestroy is used to manipulate the caches. However, it is not intuitive and people used to file-based credential caches (which are being overwritten on next kinit) as they are simply not aware of cache still active "in the background":

1. kinit admin
2. authenticate to Kerberized web app (works fine - user admin)
3. kinit fbar
4. authenticate to Kerberized web app (works fine - user fbar)
5. kdestroy
6. klist (does not show any active cache)
7. authenticate to Kerberized web app - unexpectedly authenticates as admin again

Even this is expected, kdestroy/klist do not show any active cache:

$ kdestroy
$ klist
klist: Credentials cache keyring 'persistent:17127:krb_ccache_7qITFed'
not found
$ klist -A
klist: Credentials cache keyring 'persistent:17127:krb_ccache_tTQg0zv'
not found

Ticket cache: KEYRING:persistent:17127:krb_ccache_JZtZsq0
Default principal: admin

Valid starting       Expires              Service principal
10/19/2015 16:38:05  10/20/2015 16:38:03
krbtgt/EXAMPLE.COM

Version-Release number of selected component (if applicable):
krb5-1.13.2-10.el7

How reproducible:
Always

Steps to Reproduce:
1. See above

Actual results:
See above, current implementation may simply lead to security issues as expectations of people are not met.


Expected results:

It would be better to at least indicate that there is other active cache present:

$ klist
klist: Credentials cache keyring 'persistent:17127:krb_ccache_7qITFed'
not found
klist: Other credentials cache present, use "-A" for a full list

$ kdestroy
kdestroy: Other credentials cache present, use "-A" to destroy all

Comment 2 Patrik Kis 2015-12-09 12:37:18 UTC
Maybe klist could display all caches by default, like klist -A. Just an idea.

Comment 10 Patrik Kis 2017-04-28 12:39:01 UTC
I did a little testing and as it is indicated in the upstream PR (reference in comment 5), hint was added to kdestroy, but not to klist.

@ Martin, you filed this BZ, are ok with that? If yes, we can consider this request as fixed.


More details:

[root@rhel7]# rpm -q krb5-libs
krb5-libs-1.15.1-7.el7.x86_64
[root@rhel7]# 
[root@rhel7]# echo aaa |kinit alice
Password for alice: 
[root@rhel7]# klist 
Ticket cache: KEYRING:persistent:0:krb_ccache_XrBKEoi
Default principal: alice

Valid starting       Expires              Service principal
04/28/2017 14:27:14  04/29/2017 14:27:14  krbtgt/ZMRAZ.COM
[root@rhel7]# 
[root@rhel7]# echo bbb | kinit bob
Password for bob: 
[root@rhel7]# klist 
Ticket cache: KEYRING:persistent:0:krb_ccache_PgwlFMV
Default principal: bob

Valid starting       Expires              Service principal
04/28/2017 14:27:17  04/29/2017 14:27:17  krbtgt/ZMRAZ.COM
[root@rhel7]# 
[root@rhel7]# kdestroy 
Other credential caches present, use -A to destroy all
[root@rhel7]# klist 
klist: Credentials cache keyring 'persistent:0:krb_ccache_PgwlFMV' not found
[root@rhel7]# 
[root@rhel7]# kswitch -p alice
[root@rhel7]# klist 
Ticket cache: KEYRING:persistent:0:krb_ccache_XrBKEoi
Default principal: alice

Valid starting       Expires              Service principal
04/28/2017 14:27:14  04/29/2017 14:27:14  krbtgt/ZMRAZ.COM
[root@rhel7]# 
[root@rhel7]# kdestroy 
[root@rhel7]# klist -A
[root@rhel7]# klist -l
Principal name                 Cache name
--------------                 ----------
[root@rhel7]#

Comment 14 Martin Kosek 2017-05-10 10:53:18 UTC
(In reply to Patrik Kis from comment #10)
> I did a little testing and as it is indicated in the upstream PR (reference
> in comment 5), hint was added to kdestroy, but not to klist.
> 
> @ Martin, you filed this BZ, are ok with that? If yes, we can consider this
> request as fixed.

Sorry, I missed this update. Yes, this should help to prevent/fix the original issue I had. Thank you.

Comment 15 errata-xmlrpc 2017-08-01 17:58:41 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-2017:1891


Note You need to log in before you can comment on or make changes to this bug.