Bug 891268 (CVE-2014-7141) - AUDIT-0: CVE-2014-7141: VUL-1: server:proxy/squid permissions and setbadness handling
Summary: AUDIT-0: CVE-2014-7141: VUL-1: server:proxy/squid permissions and setbadness ...
Status: RESOLVED FIXED
Alias: CVE-2014-7141
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Security (show other bugs)
Version: 201407*
Hardware: All Other
: P4 - Low : Enhancement (vote)
Target Milestone: ---
Assignee: Security Team bot
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-11 09:08 UTC by Boris Manojlovic
Modified: 2016-04-27 20:17 UTC (History)
7 users (show)

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


Attachments
squid-icmp-DoS.patch (7.42 KB, patch)
2014-09-09 08:39 UTC, Sebastian Krahmer
Details | Diff
icmp pinger DOS patch updated to compile on 3.4.7 (8.47 KB, patch)
2014-09-16 08:38 UTC, Boris Manojlovic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Manojlovic 2014-08-11 09:08:35 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0

Squid proxy server now has correct permissions handling and as such in this moment uses setBadness in squid-rpmlintrc, so to be able to push this change into Factory we need it to be resolved with security team.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Boris Manojlovic 2014-08-11 09:09:36 UTC
Development Project: server:proxy/squid
Comment 2 Marcus Meissner 2014-08-11 13:27:25 UTC
/var/cache/squid/               squid:root      750
/var/log/squid/                 squid:root      750
/usr/sbin/pinger                root:squid      4750
/usr/sbin/basic_pam_auth        root:shadow     2750

are the permissions wanted.

First comments_
- we lived without pinger being setuid root for now. why is it needed now?


- basic_pam_auth ... sounds like a helper we have in various iterations

  /sbin/unix2_chkpwd or /sbin/unix_chkpwd

  we could use those.

logfiles ... ?
Comment 3 Boris Manojlovic 2014-08-12 13:30:04 UTC
Why now all of this?

I have just followed all things that are supposed to be done packaging this package as outlined in packaging guidelines

- Logfiles sure can be removed (that is not new stuff look at package in factory  https://build.opensuse.org/package/view_file/openSUSE:Factory/squid/squid.permissions?expand=1)
- pinger no need it is anyway for very specific use case with upstream proxy servers
- basic_pam_auth you are correct but i do not have time to write c wrapper by myself in this moment

For me returning everything as it was is ok but it is up to you to decide
Comment 4 Marcus Meissner 2014-08-14 08:11:17 UTC
we just need to review the things, which is a usual step in the process.
Comment 5 Boris Manojlovic 2014-08-14 08:17:51 UTC
Just realized that my comment could be interpreted as not well intended meaning for what I sincerely  apologize. I was questioning myself not you with first question. There was no intention to rush anything in your workflow. Sometimes text can not express what was meaning of thought process of person behind keyboard.
Comment 6 Christian Wittmer 2014-09-04 16:50:46 UTC
I did the 'setuid' root for /usr/sbin/pinger.

pinger does not work without beeing 'setuid' root.
If you have other ideas, to get this fixed then just let me know. I am open for any suggestion.
Comment 7 Sebastian Krahmer 2014-09-09 08:39:37 UTC
Created attachment 605504 [details]
squid-icmp-DoS.patch

Fixing a DoS in the ICMP pinger.
Comment 8 Sebastian Krahmer 2014-09-09 08:42:17 UTC
Please remove the suid bit from pinger and instead use
the file-capability "cap_net_raw". This suffices for opening RAW sockets.
We use the same for the ping binary too. It should work out
of the box. If it doesnt, we can adjust the pinger code.
Comment 10 Swamp Workflow Management 2014-09-11 22:00:11 UTC
bugbot adjusting priority
Comment 11 Marcus Meissner 2014-09-12 13:08:46 UTC
sebastian, did you email the squid people?
Comment 12 SMASH SMASH 2014-09-12 13:15:14 UTC
Affected packages:

SLE-11-SP3: squid3
SLE-11-SP3-PRODUCTS: squid3
SLE-11-SP3-UPTU: squid3
Comment 13 Amos Jeffries 2014-09-13 15:26:20 UTC
Squid mail server is down at present so official line of contact is cut. But I (upstream) am aware of this from reading this bug report anyway, so upstream patch and release fixing the array access segfault will be published over the next few days.

CVE-2014-0486 appears to have been assigned to unrelated software judging by the Debian security team records for it. Am getting that checked. The last advisory we were allocated was in the 36nn range, so I expect this will be something higher.

A patch implementing the cap_net_raw permission is greatly appreciated. It can be linked here or mailed to me directly.
Comment 14 Marcus Meissner 2014-09-16 05:15:21 UTC
The CVE was incorrectly used here, another CVE is needed for squid/pinger dos.
Comment 15 Sebastian Krahmer 2014-09-16 07:16:50 UTC
For me the code looks like it could run with cap_net_raw
as is. The setgid/setuid wont fail if its running non-suid
and automatically drops gid/uid in case its made +s.

If you experiance that there are other problems with the caps,
I am happy to provide a patch.
Comment 16 Boris Manojlovic 2014-09-16 08:38:26 UTC
Created attachment 606482 [details]
icmp pinger DOS patch updated to compile on 3.4.7

Fixed patch for ICMP DOS, function prototype for forgotten - fixed
Comment 17 Marcus Meissner 2014-09-22 08:05:25 UTC
from Mitre:

> From: Amos Jeffries <squid3@treenet.co.nz>

> What could happen worst-case (#1 or #3 ... flooding the parent
> processes log, slowing the entire service down and/or exhausting log
> disk space, which in turn can crash the parent process. ... The
> best-case being that some HTTP servers are assigned incorrect RTT
> values. Which adversely affects latency based routing logics ...


As far as we can tell, CVE IDs are required for cases #1 and #3:

> 1. "used to index into a string array" possibly corresponds to
> http://cwe.mitre.org/data/definitions/129.html for the modified
> default case after case 136, and approximately two other places in the
> patch

Use CVE-2014-7141.


> 3. added "if (preply.psize) < 0" code apparently corresponds to a more
> general issue with missing data validation

Use CVE-2014-7142.
Comment 18 Boris Manojlovic 2014-09-24 13:16:53 UTC
What is currently in /etc/permissions.* is (permissions-2014.08.26.1452-1.1.x86_64)
---------------------------------------------
# from the squid package
/usr/sbin/pam_auth                                      root:shadow       4755
---------------------------------------------
This corresponds to old name of current /usr/sbin/basic_pam_auth, so if we could get that renamed in permissions package (and addition of capabilities for pinger)
we would be able to close this issue and push 3.4.7 to Factory.
Package is already prepared for removal of SetBadness if work is done on permissions.

Thank you in advance.
Comment 19 Sebastian Krahmer 2014-10-08 07:53:51 UTC
Everything committed. You can close the bug if that works now.
Comment 20 Bernhard Wiedemann 2014-11-05 18:00:29 UTC
This is an autogenerated message for OBS integration:
This bug (891268) was mentioned in
https://build.opensuse.org/request/show/259903 Factory / permissions
Comment 21 Sebastian Krahmer 2014-12-09 10:57:04 UTC
done
Comment 22 Glen D'Souza 2015-06-02 07:31:30 UTC
Is this affecting sles11sp3? If yes - can we expect a patch for it?
Comment 23 Sebastian Krahmer 2015-06-02 07:59:12 UTC
Since sle11sp3 should not have a mode 04750 pinger, and the issue is low
severity its not necessary to patch it.

However, the DoS patch could be included in the next regular squid update
for sle11sp3.
Comment 26 Swamp Workflow Management 2015-10-30 13:10:29 UTC
SUSE-RU-2015:1848-1: An update that has 6 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 685093,891268,895647,904060,906336,943471
CVE References: 
Sources used:
SUSE Linux Enterprise Server 12 (src):    permissions-2015.09.28.1626-3.1
SUSE Linux Enterprise Desktop 12 (src):    permissions-2015.09.28.1626-3.1
Comment 27 Swamp Workflow Management 2015-11-12 13:19:26 UTC
openSUSE-RU-2015:1973-1: An update that has 6 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 685093,891268,895647,904060,906336,943471
CVE References: 
Sources used:
openSUSE Leap 42.1 (src):    permissions-2015.09.28.1626-5.1