Bug 851116 (CVE-2013-3709) - VUL-0: CVE-2013-3709: webyast: local privilege escalation via secret rails tokens execution
Summary: VUL-0: CVE-2013-3709: webyast: local privilege escalation via secret rails to...
Status: RESOLVED FIXED
Alias: CVE-2013-3709
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P2 - High : Major
Target Milestone: ---
Deadline: 2014-01-03
Assignee: Security Team bot
QA Contact: Security Team bot
URL:
Whiteboard: maint:released:sle11-sp2:55212
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 15:58 UTC by Victor Pereira
Modified: 2014-01-06 15:04 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Pereira 2013-11-19 15:58:59 UTC
WebYast appears to use a default "secret token". Based on this know information, an attacker could launch a remote code execution attack


references:

https://github.com/webyast/webyast/blob/master/webyast/config/initializers/secret_token.rb

https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/rails_secret_deserialization.rb
Comment 1 Sebastian Krahmer 2013-11-19 16:00:25 UTC
We need to check that the secret token is not predictable on
installations.

More on the background:

http://robertheaton.com/2013/07/22/how-to-hack-a-rails-app-using-its-secret-token/
Comment 2 Marcus Meissner 2013-11-20 06:53:20 UTC
osci less SUSE:SLE-11-SP2:Update:Test   webyast-base rcwebyast

has:

  #generate deployment specific secret key (bnc#591345)
  SECRET=`cd /srv/www/webyast/ && rake -s secret`

and also:
  sed -i 's/a25bdf1cfcaea649ced4549e9d2b2b6ad4cf077badc774ca034a7ba57ae17f6e1185ed07bcc4ac20fb2d062d2afa975024fca03ede7b4c5002ca68386caa27a0/'"$SECRET"/ /srv/www/webyast/config/initializers/secret_token.rb
Comment 3 Sebastian Krahmer 2013-11-20 08:13:50 UTC
Unfortunally, the file that contains the token is
world readable:

krahmer@aal:~> ls -la /srv/www/yast/config/initializers/session_store.rb
-rw-r--r-- 1 root root 824 Nov  7 14:09 /srv/www/yast/config/initializers/session_store.rb

So that local users can obtain this and execute code
as webyast user on the local machine, which should be as good
as a local root exploit.
Comment 4 Sebastian Krahmer 2013-11-20 08:15:11 UTC
This vulnerability was reported by joernchen of Phenoelit.

In the update announce message, it would be good to thank and credit
him for reporting this to us. (SWAMP description text).
Comment 5 Marcus Meissner 2013-11-22 11:16:27 UTC
so given that the keys and tokens are regenerated on starting, this is just a local problem due to those files being world readable

nethertheless, as webyast is basically having root rights, this is a local privilege escalation.
Comment 6 Marcus Meissner 2013-11-22 11:19:27 UTC
I have assigned from our CVE Pool CVE-2013-3709:

Due to the secret tokens being worldreadable several webyast components could be leveraged by attackers on the local machine to gain root privileges.
Comment 7 Marcus Meissner 2013-11-22 11:26:31 UTC
packages affected (at least):

webyast-base-ui
webyast-base-ws

(if you remember other components of ATK 1.3 doing this kind of secrets, please check them too.)
Comment 8 Marcus Meissner 2013-11-22 12:05:31 UTC
last packages were ATK 1.2

in ATK 1.3 it seems to be in: 

webyast-base
Comment 9 Swamp Workflow Management 2013-11-22 12:07:47 UTC
The SWAMPID for this issue is 55210.
This issue was rated as important.
Please submit fixed packages until 2013-11-29.
When done, please reassign the bug to security-team@suse.de.
Patchinfo will be handled by security team.
Comment 10 Ladislav Slezák 2013-11-27 13:05:56 UTC
I'm preparing an update for ATK-1.3, openSUSE 13.1, 12.3 and 12.2.

I'd like also to fix ATK-1.2 version (although officially out of support) as the webyast SP2 repositories are still available via NCC and someone could install obsoleted version with a security problem.
Comment 11 Ladislav Slezák 2013-11-29 17:47:31 UTC
Status update: I'm still working on the fix, I found some problems in my patches, (hopefully fixed, need some testing).

The current (may not be final yet) patches can be found in https://build.suse.de/package/show/home:lslezak:branches:SUSE:SLE-11-SP2:Update:Products:Test/webyast-base and https://build.suse.de/package/show/home:lslezak:branches:SUSE:SLE-11-SP1:Update:ATK:1.2:Update:Test/webyast-base-ui
Comment 12 Marcus Meissner 2013-11-29 18:44:29 UTC
atk 1.2 is not maintained anymore, no need to fix I think
Comment 13 Ladislav Slezák 2013-12-02 10:29:29 UTC
Yes, ATK-1.2 is officially not supported anymore, but I'd like to fix it anyway. The problem is that WY-1.2 was also released as WebYast for SLES (NCC automatically adds the WY repo during SP2 registration).

Nobody dares to touch the NCC config and the problem is that the customers do not know that they should upgrade to ATK-1.3 by downloading extra add-on ISO...

Leaving them with insecure 1.2 version is a bit problematic IMHO, I'd rather fix it also there (anything else but a security problem I'd happily ignore in 1.2).
Comment 16 Ladislav Slezák 2013-12-02 12:34:27 UTC
Fixed by these SR:

Created submit request 29742 to SUSE:SLE-11-SP2:Update:Products:Test
(https://build.suse.de/request/show/29742)

Created submit request 29743 to SUSE:SLE-11-SP1:Update:ATK:1.2:Update:Test
(https://build.suse.de/request/show/29743)

I'll submit openSUSE fixes after the SLE fixes are released.
Comment 17 Ladislav Slezák 2013-12-02 13:11:04 UTC
BTW do not forget to credit "joernchen of Phenoelit" in the patch description, see comment #4.
Comment 19 Sebastian Krahmer 2013-12-16 11:55:28 UTC
Please submit openSUSE fixes.
Comment 20 Ladislav Slezák 2013-12-16 12:11:27 UTC
Ok, will do...
Comment 21 Swamp Workflow Management 2013-12-16 14:51:47 UTC
Update released for: webyast-base, webyast-base-branding-default, webyast-base-testsuite, webyast-base-ui, webyast-base-ui-branding-default, webyast-base-ui-testsuite
Products:
SLE-SLMS 1.3 (x86_64)
SLE-STUDIOONSITE 1.3 (x86_64)
SLE-WEBYAST 1.3 (i386, ia64, ppc64, s390x, x86_64)
Comment 22 Ladislav Slezák 2013-12-16 22:28:40 UTC
Fixed in openSUSE:

https://build.opensuse.org/request/show/211120 (12.2)
https://build.opensuse.org/request/show/211121 (12.3)
https://build.opensuse.org/request/show/211122 (13.1)

Security team: please, release the patches.
Comment 23 Sebastian Krahmer 2013-12-17 11:56:24 UTC
darix suggested to also fix that in the git,
if thats a different branch.
Comment 24 Ladislav Slezák 2013-12-17 13:24:49 UTC
Yes, I'll push the changes to Git, I just want to wait for releasing the openSUSE updates.
Comment 26 Swamp Workflow Management 2013-12-25 17:04:23 UTC
openSUSE-SU-2013:1952-1: An update that fixes one vulnerability is now available.

Category: security (important)
Bug References: 851116
CVE References: CVE-2013-3709
Sources used:
openSUSE 12.3 (src):    webyast-base-0.3.43.1-1.4.1
Comment 27 Swamp Workflow Management 2013-12-25 17:10:19 UTC
openSUSE-SU-2013:1961-1: An update that fixes one vulnerability is now available.

Category: security (important)
Bug References: 851116
CVE References: CVE-2013-3709
Sources used:
openSUSE 13.1 (src):    webyast-base-0.3.45.1-2.4.1
Comment 28 Swamp Workflow Management 2013-12-27 10:19:57 UTC
The SWAMPID for this issue is 55631.
This issue was rated as important.
Please submit fixed packages until 2014-01-03.
When done, please reassign the bug to security-team@suse.de.
Patchinfo will be handled by security team.
Comment 29 Marcus Meissner 2013-12-27 10:30:28 UTC
The issue is a bit difficult.

ATK 1.2 with Webyast 1.2 is EOLed, however Webyast 1.2 is also added by default
to SLES 11 SP2, which is still maintained.

lets do an update for webyast 1.2 so it gets there.


Test on SLES 11 SP2 addon only
Comment 31 Swamp Workflow Management 2014-01-06 11:51:17 UTC
Update released for: webyast-base-ui, webyast-base-ui-branding-default, webyast-base-ui-testsuite
Products:
SLE-WEBYAST 1.2 (i386, ia64, ppc64, s390x, x86_64)
Comment 32 Swamp Workflow Management 2014-01-06 15:04:22 UTC
SUSE-SU-2014:0022-1: An update that fixes one vulnerability is now available.

Category: security (important)
Bug References: 851116
CVE References: CVE-2013-3709
Sources used:
WebYaST 1.2 (src):    webyast-base-ui-0.2.64-0.3.1