Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1) - Nessus

High   Plugin ID: 150692

This page contains detailed information about the Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 150692
Name: Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1)
Filename: ubuntu_USN-4987-1.nasl
Vulnerability Published: 2021-04-23
This Plugin Published: 2021-06-10
Last Modification Time: 2021-12-13
Plugin Version: 1.5
Plugin Type: local
Plugin Family: Ubuntu Local Security Checks
Dependencies: ssh_get_info.nasl
Required KB Items [?]: Host/cpu, Host/Debian/dpkg-l, Host/Ubuntu, Host/Ubuntu/release

Vulnerability Information


Severity: High
Vulnerability Published: 2021-04-23
Patch Published: 2021-06-10
CVE [?]: CVE-2021-22204
CPE [?]: cpe:/o:canonical:ubuntu_linux:18.04:-:lts, cpe:/o:canonical:ubuntu_linux:20.04:-:lts, cpe:/o:canonical:ubuntu_linux:20.10, cpe:/o:canonical:ubuntu_linux:21.04, p-cpe:/a:canonical:ubuntu_linux:libimage-exiftool-perl
Exploited by Malware: True

Synopsis

The remote Ubuntu host is missing a security update.

Description

The remote Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 host has a package installed that is affected by a vulnerability as referenced in the USN-4987-1 advisory.

- Improper neutralization of user data in the DjVu file format in ExifTool versions 7.44 and up allows arbitrary code execution when parsing the malicious image (CVE-2021-22204)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Update the affected libimage-exiftool-perl package.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1) vulnerability:

  1. Metasploit: exploit/unix/fileformat/exiftool_djvu_ant_perl_injection
    [ExifTool DjVu ANT Perl injection]
  2. Metasploit: exploit/multi/http/gitlab_exif_rce
    [GitLab Unauthenticated Remote ExifTool Command Injection]
  3. Exploit-DB: exploits/ruby/webapps/50532.txt
    [EDB-50532: GitLab 13.10.2 - Remote Code Execution (RCE) (Unauthenticated)]
  4. GitHub: https://github.com/0xBruno/CVE-2021-22204
    [CVE-2021-22204: A complete PoC for CVE-2021-22204 exiftool RCE]
  5. GitHub: https://github.com/0xsyr0/OSCP
    [CVE-2021-22204]
  6. GitHub: https://github.com/Al1ex/CVE-2021-22205
    [CVE-2021-22204]
  7. GitHub: https://github.com/AssassinUKG/CVE-2021-22204
    [CVE-2021-22204]
  8. GitHub: https://github.com/BBurgarella/CVE-2021-22204
    [CVE-2021-22204: My own python implementation of a CVE-2021-22204 exploit]
  9. GitHub: https://github.com/CsEnox/Gitlab-Exiftool-RCE
    [CVE-2021-22204]
  10. GitHub: https://github.com/EdgeSecurityTeam/Vulnerability
    [CVE-2021-22204]
  11. GitHub: https://github.com/GatoGamer1155/CVE-2021-22204
    [CVE-2021-22204: Script en python para crear imagenes maliciosas (reverse shell)]
  12. GitHub: https://github.com/Konstantinos-Papanagnou/CMSpit
    [CVE-2021-22204]
  13. GitHub: https://github.com/LazyTitan33/CVE-2021-22204
    [CVE-2021-22204]
  14. GitHub: https://github.com/PenTestical/CVE-2021-22204
    [CVE-2021-22204]
  15. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2021-22204]
  16. GitHub: https://github.com/binganao/vulns-2022
    [CVE-2021-22204]
  17. GitHub: https://github.com/convisoappsec/CVE-2021-22204-exiftool
    [CVE-2021-22204: Python exploit for the CVE-2021-22204 vulnerability in Exiftool]
  18. GitHub: https://github.com/devdanqtuan/CVE-2021-22205
    [CVE-2021-22204]
  19. GitHub: https://github.com/gkhan496/WDIR
    [CVE-2021-22204]
  20. GitHub: https://github.com/harsh-bothra/learn365
    [CVE-2021-22204]
  21. GitHub: https://github.com/hongson97/ctf-challenges
    [CVE-2021-22204]
  22. GitHub: https://github.com/htrgouvea/research
    [CVE-2021-22204]
  23. GitHub: https://github.com/johnjhacking/CVE-2021-22204-Payloads-and-Steps
    [CVE-2021-22204: Additional payloads and functions]
  24. GitHub: https://github.com/mr-r3bot/Gitlab-CVE-2021-22205
    [CVE-2021-22204]
  25. GitHub: https://github.com/oneoy/Gitlab-Exiftool-RCE
    [CVE-2021-22204]
  26. GitHub: https://github.com/pizza-power/Golang-CVE-2021-22205-POC
    [CVE-2021-22204]
  27. GitHub: https://github.com/runsel/GitLab-CVE-2021-22205-
    [CVE-2021-22204]
  28. GitHub: https://github.com/star-sg/CVE
    [CVE-2021-22204]
  29. GitHub: https://github.com/szTheory/exifcleaner
    [CVE-2021-22204]
  30. GitHub: https://github.com/trganda/CVE-2021-22204
    [CVE-2021-22204]
  31. GitHub: https://github.com/bilkoh/POC-CVE-2021-22204
    [CVE-2021-22204: POC for exiftool vuln (CVE-2021-22204).]
  32. GitHub: https://github.com/convisolabs/CVE-2021-22204-exiftool
    [CVE-2021-22204: Python exploit for the CVE-2021-22204 vulnerability in Exiftool]
  33. GitHub: https://github.com/ph-arm/CVE-2021-22204-Gitlab
    [CVE-2021-22204: Modification of gitlab exploit anything under 13.10]
  34. GitHub: https://github.com/se162xg/CVE-2021-22204
    [CVE-2021-22204: Exiftool arbitrary code execution vulnerability]
  35. GitHub: https://github.com/tuhin81/CVE-2021-22204-exiftool
    [CVE-2021-22204: Exiftool exploit]
  36. GitHub: https://github.com/UNICORDev/exploit-CVE-2021-22204
    [CVE-2021-22204: Exploit for CVE-2021-22204 (ExifTool)]
  37. GitHub: https://github.com/Asaad27/CVE-2021-22204-RSE
    [CVE-2021-22204: Reverse shell execution exploit of CVE 22204]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2021-22204
CVSS V2 Vector: AV:N/AC:M/Au:N/C:P/I:P/A:P/E:H/RL:OF/RC:C
CVSS Base Score:6.8 (Medium)
Impact Subscore:6.4
Exploitability Subscore:8.6
CVSS Temporal Score:5.9 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:5.9 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:7.8 (High)
Impact Subscore:5.9
Exploitability Subscore:1.8
CVSS Temporal Score:7.5 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:7.5 (High)

Go back to menu.

Plugin Source


This is the ubuntu_USN-4987-1.nasl nessus plugin source code. Ubuntu Security Notice (C) 2021 Canonical, Inc. / NASL script (C) 2021 and is owned by Tenable, Inc. or an Affiliate thereof.

#%NASL_MIN_LEVEL 70300
##
# (C) Tenable Network Security, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Ubuntu Security Notice USN-4987-1. The text
# itself is copyright (C) Canonical, Inc. See
# <https://ubuntu.com/security/notices>. Ubuntu(R) is a registered
# trademark of Canonical, Inc.
##

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(150692);
  script_version("1.5");
  script_set_attribute(attribute:"plugin_modification_date", value:"2021/12/13");

  script_cve_id("CVE-2021-22204");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2021/12/01");
  script_xref(name:"USN", value:"4987-1");

  script_name(english:"Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1)");

  script_set_attribute(attribute:"synopsis", value:
"The remote Ubuntu host is missing a security update.");
  script_set_attribute(attribute:"description", value:
"The remote Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 host has a package installed that is affected by a vulnerability
as referenced in the USN-4987-1 advisory.

  - Improper neutralization of user data in the DjVu file format in ExifTool versions 7.44 and up allows
    arbitrary code execution when parsing the malicious image (CVE-2021-22204)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://ubuntu.com/security/notices/USN-4987-1");
  script_set_attribute(attribute:"solution", value:
"Update the affected libimage-exiftool-perl package.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2021-22204");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'ExifTool DjVu ANT Perl injection');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2021/04/23");
  script_set_attribute(attribute:"patch_publication_date", value:"2021/06/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2021/06/10");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:18.04:-:lts");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:20.04:-:lts");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:20.10");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:21.04");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libimage-exiftool-perl");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Ubuntu Local Security Checks");

  script_copyright(english:"Ubuntu Security Notice (C) 2021 Canonical, Inc. / NASL script (C) 2021 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/cpu", "Host/Ubuntu", "Host/Ubuntu/release", "Host/Debian/dpkg-l");

  exit(0);
}

include('audit.inc');
include('ubuntu.inc');
include('misc_func.inc');

if ( ! get_kb_item('Host/local_checks_enabled') ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
release = get_kb_item('Host/Ubuntu/release');
if ( isnull(release) ) audit(AUDIT_OS_NOT, 'Ubuntu');
release = chomp(release);
if (! preg(pattern:"^(18\.04|20\.04|20\.10|21\.04)$", string:release)) audit(AUDIT_OS_NOT, 'Ubuntu 18.04 / 20.04 / 20.10 / 21.04', 'Ubuntu ' + release);
if ( ! get_kb_item('Host/Debian/dpkg-l') ) audit(AUDIT_PACKAGE_LIST_MISSING);

cpu = get_kb_item('Host/cpu');
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ('x86_64' >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, 'Ubuntu', cpu);


pkgs = [
    {'osver': '18.04', 'pkgname': 'libimage-exiftool-perl', 'pkgver': '10.80-1ubuntu0.1'},
    {'osver': '20.04', 'pkgname': 'libimage-exiftool-perl', 'pkgver': '11.88-1ubuntu0.1'},
    {'osver': '20.10', 'pkgname': 'libimage-exiftool-perl', 'pkgver': '12.05-1ubuntu0.1'},
    {'osver': '21.04', 'pkgname': 'libimage-exiftool-perl', 'pkgver': '12.16+dfsg-1ubuntu0.1'}
];

flag = 0;
foreach package_array ( pkgs ) {
  osver = NULL;
  pkgname = NULL;
  pkgver = NULL;
  if (!empty_or_null(package_array['osver'])) osver = package_array['osver'];
  if (!empty_or_null(package_array['pkgname'])) pkgname = package_array['pkgname'];
  if (!empty_or_null(package_array['pkgver'])) pkgver = package_array['pkgver'];
  if (osver && pkgname && pkgver) {
    if (ubuntu_check(osver:osver, pkgname:pkgname, pkgver:pkgver)) flag++;
  }
}

if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_WARNING,
    extra      : ubuntu_report_get()
  );
  exit(0);
}
else
{
  tested = ubuntu_pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, 'libimage-exiftool-perl');
}

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/ubuntu_USN-4987-1.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\ubuntu_USN-4987-1.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/ubuntu_USN-4987-1.nasl

Go back to menu.

How to Run


Here is how to run the Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Ubuntu Local Security Checks plugin family.
  6. On the right side table select Ubuntu 18.04 LTS / 20.04 LTS / 20.10 / 21.04 : ExifTool vulnerability (USN-4987-1) plugin ID 150692.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl ubuntu_USN-4987-1.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a ubuntu_USN-4987-1.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - ubuntu_USN-4987-1.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state ubuntu_USN-4987-1.nasl -t <IP/HOST>

Go back to menu.

References


USN | Ubuntu Security Notice: See also: Similar and related Nessus plugins:
  • 149515 - Debian DLA-2663-1 : libimage-exiftool-perl security update
  • 149218 - Debian DSA-4910-1 : libimage-exiftool-perl - security update
  • 149550 - openSUSE Security Update : perl-Image-ExifTool (openSUSE-2021-707)
  • 155448 - Security Updates for Microsoft Office (November 2021) (macOS)
  • 154982 - Security Updates for Microsoft Excel Products (November 2021)
  • 154999 - Security Updates for Exchange (November 2021)
  • 155962 - Security Updates for Exchange (November 2021) (Remote)
  • 155000 - Security Updates for Microsoft Office Products (November 2021)
  • 154037 - KB5006667: Windows 10 version 1909 Security Update (October 2021)
  • 154034 - KB5006669: Windows 10 Version 1607 and Windows Server 2016 Security Update (October 2021)
  • 154033 - KB5006670: Windows 10 Version 2004 / Windows 10 Version 20H2 / Windows 10 Version 21H1 October 2021 Security Update
  • 154026 - KB5006672: Windows 10 Version 1809 and Windows Server 2019 Security Update (October 2021)
  • 154042 - KB5006674: Windows 11 Security Update (October 2021)
  • 154041 - KB5006675: WWindows 10 version 1507 LTS Security Update (October 2021)
  • 154029 - KB5006699: Windows Server 2022 Security Update (October 2021)
  • 154043 - KB5006715: Windows Server 2008 Security Update (October 2021)
  • 154035 - KB5006728: Windows 7 and Windows Server 2008 R2 Security Update (October 2021)
  • 154040 - KB5006729: Windows Server 2012 R2 Security Update (October 2021)
  • 154036 - KB5006732: Windows Server 2012 Security Update (October 2021)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file ubuntu_USN-4987-1.nasl version 1.5. For more plugins, visit the Nessus Plugin Library.

Go back to menu.