Bug 1706826 (CVE-2017-18367)

Summary: CVE-2017-18367 libseccomp-golang: mishandling of multiple argument rules leading to a bypass of intended access restrictions
Product: [Other] Security Response Reporter: Marian Rehak <mrehak>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ahardin, aos-bugs, bleanhar, bmontgom, ccoleman, dedgar, eparis, go-sig, jburrell, jchaloup, jgoulding, jokerman, maszulik, mchappel, mfojtik, nstielau, sponnaga, sttts
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libseccomp-golang 0.9.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-17 08:09:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1706828, 1706829, 1728130, 1728131, 1779016, 1779017, 1779018, 1779019, 1779020    
Bug Blocks: 1706830    

Description Marian Rehak 2019-05-06 11:11:22 UTC
libseccomp-golang 0.9.0 and earlier incorrectly generates BPFs that OR multiple arguments rather than ANDing them. A process running under a restrictive seccomp filter that specified multiple syscall arguments could bypass intended access restrictions by specifying a single matching argument.

External References:
https://www.openwall.com/lists/oss-security/2019/04/25/6

Upstream Bug:
https://github.com/seccomp/libseccomp-golang/issues/22

Upstream Patch:
https://github.com/seccomp/libseccomp-golang/commit/06e7a29f36a34b8cf419aeb87b979ee508e58f9e

Comment 1 Marian Rehak 2019-05-06 11:15:19 UTC
Created golang-github-seccomp-libseccomp-golang tracking bugs for this issue:

Affects: epel-6 [bug 1706829]
Affects: fedora-all [bug 1706828]

Comment 2 Jason Shepherd 2019-07-09 05:48:39 UTC
This issue affects

Comment 9 errata-xmlrpc 2019-12-17 02:17:22 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.1

Via RHSA-2019:4087 https://access.redhat.com/errata/RHSA-2019:4087

Comment 10 errata-xmlrpc 2019-12-17 07:40:03 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.1

Via RHSA-2019:4090 https://access.redhat.com/errata/RHSA-2019:4090

Comment 11 Product Security DevOps Team 2019-12-17 08:09:24 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2017-18367

Comment 12 Mauro Matteo Cascella 2020-02-21 15:51:07 UTC
Statement:

This issue may affect OpenShift Container Platform 3.x and 4.x if you are providing a custom Seccomp profile using Security Context Constraints [1]. The custom Seccomp profile would need to specify multiple arguments, such as below, from [2].

{
  "names": [
    "socketcall"
  ],
  "action": "SCMP_ACT_ALLOW",
  "args": [
    {
      "index": 0,
      "value": 1,
      "valueTwo": 0,
      "op": "SCMP_CMP_EQ"
    },
    {
      "index": 1,
      "value": 1,
      "valueTwo": 0,
      "op": "SCMP_CMP_EQ"
    }
  ],
  "comment": "",
  "includes": {},
  "excludes": {}
},

If such a profile was used the arguments could be combined as an OR rule, not AND, as the user might expect from Seccomp.

[1] https://docs.openshift.com/container-platform/4.1/authentication/managing-security-context-constraints.html

[2] https://github.com/moby/moby/issues/32714#issuecomment-295532163

Comment 13 errata-xmlrpc 2020-06-18 21:11:26 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 3.11

Via RHSA-2020:2479 https://access.redhat.com/errata/RHSA-2020:2479