Vulnerabilities > CVE-2006-0705 - USE of Externally-Controlled Format String vulnerability in multiple products
Summary
Format string vulnerability in a logging function as used by various SFTP servers, including (1) AttachmateWRQ Reflection for Secure IT UNIX Server before 6.0.0.9, (2) Reflection for Secure IT Windows Server before 6.0 build 38, (3) F-Secure SSH Server for Windows before 5.3 build 35, (4) F-Secure SSH Server for UNIX 3.0 through 5.0.8, (5) SSH Tectia Server 4.3.6 and earlier and 4.4.0, and (6) SSH Shell Server 3.2.9 and earlier, allows remote authenticated users to execute arbitrary commands via unspecified vectors, involving crafted filenames and the stat command.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Format String Injection An attacker includes formatting characters in a string input field on the target application. Most applications assume that users will provide static text and may respond unpredictably to the presence of formatting character. For example, in certain functions of the C programming languages such as printf, the formatting character %s will print the contents of a memory location expecting this location to identify a string and the formatting character %n prints the number of DWORD written in the memory. An attacker can use this to read or write to memory locations or files, or simply to manipulate the value of the resulting text in unexpected ways. Reading or writing memory may result in program crashes and writing memory could result in the execution of arbitrary code if the attacker can write to the program stack.
- String Format Overflow in syslog() This attack targets the format string vulnerabilities in the syslog() function. An attacker would typically inject malicious input in the format string parameter of the syslog function. This is a common problem, and many public vulnerabilities and associated exploits have been posted.
Nessus
NASL family Misc. NASL id SSH_TECTIA_SERVER_SFTP_FORMAT_STRING.NASL description The remote host is running SSH Tectia Server, a commercial SSH server. According to its banner, the installed version of this software contains a format string vulnerability in its sftp subsystem. A remote, authenticated attacker may be able to execute arbitrary code on the affected host subject to his privileges or crash the server itself. last seen 2020-06-01 modified 2020-06-02 plugin id 20927 published 2006-02-15 reporter This script is Copyright (C) 2006-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/20927 title SSH Tectia Server SFTP Filename Logging Format String code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(20927); script_version("1.16"); script_cve_id("CVE-2006-0705"); script_bugtraq_id(16640); script_name(english:"SSH Tectia Server SFTP Filename Logging Format String"); script_summary(english:"Checks for format string vulnerability in SSH Tectia Server SFTP subsystem"); script_set_attribute(attribute:"synopsis", value: "The remote SSH server may be affected by a format string vulnerability." ); script_set_attribute(attribute:"description", value: "The remote host is running SSH Tectia Server, a commercial SSH server. According to its banner, the installed version of this software contains a format string vulnerability in its sftp subsystem. A remote, authenticated attacker may be able to execute arbitrary code on the affected host subject to his privileges or crash the server itself." ); script_set_attribute(attribute:"see_also", value:"http://www.ssh.com/company/newsroom/article/715/" ); script_set_attribute(attribute:"solution", value: "As a temporary solution, disable the sftp subsystem as described in the vendor advisory above. A better solution, though, is to upgrade to SSH Tectia Server version 4.3.7 or 4.4.2 or later." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available"); script_set_attribute(attribute:"exploit_available", value:"false"); script_set_attribute(attribute:"plugin_publication_date", value: "2006/02/15"); script_set_attribute(attribute:"vuln_publication_date", value: "2006/02/13"); script_cvs_date("Date: 2018/07/30 15:31:32"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_set_attribute(attribute:"cpe", value:"cpe:/a:ssh:tectia_serve"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"Misc."); script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc."); script_dependencies("ssh_detect.nasl"); script_require_ports("Services/ssh", 22); exit(0); } include("backport.inc"); port = get_kb_item("Services/ssh"); if (!port) port = 22; banner = get_kb_item("SSH/banner/" + port); if ( ! banner ) exit(0); banner = get_backport_banner(banner:banner); if ( ereg(pattern:"^SSH-2\.0-([0-3]\..*|4\.([0-2]\..*|3\.[0-6]\..*|4\.[01]\..*)) SSH Tectia Server", string:banner) ) { security_warning(port); }
NASL family Misc. NASL id WRQ_REFLECTION_SFTP_FORMAT_STRING.NASL description The remote host is running AttachmateWRQ Reflection for Secure IT Server / F-Secure SSH Server, a commercial SSH server. According to its banner, the installed version of this software contains a format string vulnerability in its sftp subsystem. A remote, authenticated attacker may be able to execute arbitrary code on the affected host subject to his privileges or crash the server itself. last seen 2020-06-01 modified 2020-06-02 plugin id 20902 published 2006-02-14 reporter This script is Copyright (C) 2006-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/20902 title AttachmateWRQ Reflection for Secure IT Server SFTP Format String code # # (C) Tenable Network Security # include("compat.inc"); if (description) { script_id(20902); script_version("1.15"); script_cve_id("CVE-2006-0705"); script_bugtraq_id(16625); script_xref(name:"CERT", value:"419241"); script_name(english:"AttachmateWRQ Reflection for Secure IT Server SFTP Format String"); script_summary(english:"Checks for format string vulnerability in AttachmateWRQ Reflection for Secure IT Server SFTP subsystem"); script_set_attribute(attribute:"synopsis", value: "The remote SSH server is affected by a format string vulnerability." ); script_set_attribute(attribute:"description", value: "The remote host is running AttachmateWRQ Reflection for Secure IT Server / F-Secure SSH Server, a commercial SSH server. According to its banner, the installed version of this software contains a format string vulnerability in its sftp subsystem. A remote, authenticated attacker may be able to execute arbitrary code on the affected host subject to his privileges or crash the server itself." ); script_set_attribute(attribute:"see_also", value:"https://support.microfocus.com/techdocs/1882.html" ); script_set_attribute(attribute:"solution", value: "Either upgrade as described in the vendor advisory above or edit the software's configuration to disable the SFTP subsystem." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N"); script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available"); script_set_attribute(attribute:"exploit_available", value:"false"); script_set_attribute(attribute:"plugin_publication_date", value: "2006/02/14"); script_set_attribute(attribute:"vuln_publication_date", value: "2006/02/13"); script_cvs_date("Date: 2018/11/15 20:50:24"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"Misc."); script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc."); script_dependencies("ssh_detect.nasl"); script_require_ports("Services/ssh", 22); exit(0); } port = get_kb_item("Services/ssh"); if (!port) port = 22; banner = get_kb_item("SSH/banner/" + port); if (banner) { if ("ReflectionForSecureIT" >< banner) { if ( # Reflection for Secure IT Windows Server versions 6.x < 6.0 build 38. egrep(pattern:"WRQReflectionForSecureIT_6\.0 Build ([0-2]|3[0-4])", string:banner) || # Reflection for Secure IT UNIX Server versions 6.x < 6.0.0.9. egrep(pattern:"ReflectionForSecureIT_6\.0\.0\.[0-8]", string:banner) ) security_warning(port); } else if ("F-Secure SSH" >< banner) { if ( # F-Secure SSH Server for Windows versions 5.x < 5.3 build 35. egrep(pattern:"SSH-2\.0-5\.([0-2].*|3 Build ([0-2].*|3[0-4])) F-Secure SSH Windows", string:banner) || # F-Secure SSH Server for UNIX versions 3.x and 5.x < 5.0.8. egrep(pattern:"SSH-2\.0-(3\..*|5\.0\.[0-7]) F-Secure SSH", string:banner) ) security_warning(port); } }
NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_594AD3C5A39B11DA926C0800209ADF0E.NASL description SSH Communications Security Corp reports a format string vulnerability in their SFTP server. This vulnerability could cause a user with SCP/SFTP access only to get permission to execute also other commands. It could also allow user A to create a special file that when accessed by user B allows user A to execute commands as user B. last seen 2020-06-01 modified 2020-06-02 plugin id 21431 published 2006-05-13 reporter This script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/21431 title FreeBSD : SSH.COM SFTP server -- format string vulnerability (594ad3c5-a39b-11da-926c-0800209adf0e) code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from the FreeBSD VuXML database : # # Copyright 2003-2018 Jacques Vidrine and contributors # # Redistribution and use in source (VuXML) and 'compiled' forms (SGML, # HTML, PDF, PostScript, RTF and so forth) with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributions of source code (VuXML) must retain the above # copyright notice, this list of conditions and the following # disclaimer as the first lines of this file unmodified. # 2. Redistributions in compiled form (transformed to other DTDs, # published online in any format, converted to PDF, PostScript, # RTF and other formats) must reproduce the above copyright # notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # # THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include("compat.inc"); if (description) { script_id(21431); script_version("1.17"); script_cvs_date("Date: 2019/08/02 13:32:38"); script_cve_id("CVE-2006-0705"); script_bugtraq_id(16640); script_xref(name:"Secunia", value:"18828"); script_name(english:"FreeBSD : SSH.COM SFTP server -- format string vulnerability (594ad3c5-a39b-11da-926c-0800209adf0e)"); script_summary(english:"Checks for updated packages in pkg_info output"); script_set_attribute( attribute:"synopsis", value: "The remote FreeBSD host is missing one or more security-related updates." ); script_set_attribute( attribute:"description", value: "SSH Communications Security Corp reports a format string vulnerability in their SFTP server. This vulnerability could cause a user with SCP/SFTP access only to get permission to execute also other commands. It could also allow user A to create a special file that when accessed by user B allows user A to execute commands as user B." ); # http://www.ssh.com/company/newsroom/article/715/ script_set_attribute( attribute:"see_also", value:"https://www.ssh.com/ssh/sftp/" ); # http://www.frsirt.com/english/advisories/2006/0554 script_set_attribute( attribute:"see_also", value:"http://www.frsirt.com" ); # http://securitytracker.com/id?1015619 script_set_attribute( attribute:"see_also", value:"https://securitytracker.com/id?1015619" ); # http://xforce.iss.net/xforce/xfdb/24651 script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?7d49eeca" ); # https://vuxml.freebsd.org/freebsd/594ad3c5-a39b-11da-926c-0800209adf0e.html script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?2612ee45" ); script_set_attribute(attribute:"solution", value:"Update the affected packages."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:P/A:P"); script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available"); script_set_attribute(attribute:"exploit_available", value:"true"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:ssh2"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:ssh2-nox11"); script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd"); script_set_attribute(attribute:"vuln_publication_date", value:"2006/02/13"); script_set_attribute(attribute:"patch_publication_date", value:"2006/03/04"); script_set_attribute(attribute:"plugin_publication_date", value:"2006/05/13"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2006-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_family(english:"FreeBSD Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info"); exit(0); } include("audit.inc"); include("freebsd_package.inc"); if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED); if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD"); if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (pkg_test(save_report:TRUE, pkg:"ssh2<3.2.9.1_5")) flag++; if (pkg_test(save_report:TRUE, pkg:"ssh2-nox11<3.2.9.1_5")) flag++; if (flag) { if (report_verbosity > 0) security_warning(port:0, extra:pkg_report_get()); else security_warning(0); exit(0); } else audit(AUDIT_HOST_NOT, "affected");
NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-200703-13.NASL description The remote host is affected by the vulnerability described in GLSA-200703-13 (SSH Communications Security last seen 2020-06-01 modified 2020-06-02 plugin id 24830 published 2007-03-16 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/24830 title GLSA-200703-13 : SSH Communications Security's Secure Shell Server: SFTP privilege escalation code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Gentoo Linux Security Advisory GLSA 200703-13. # # The advisory text is Copyright (C) 2001-2015 Gentoo Foundation, Inc. # and licensed under the Creative Commons - Attribution / Share Alike # license. See http://creativecommons.org/licenses/by-sa/3.0/ # include("compat.inc"); if (description) { script_id(24830); script_version("1.14"); script_cvs_date("Date: 2019/08/02 13:32:44"); script_cve_id("CVE-2006-0705"); script_xref(name:"GLSA", value:"200703-13"); script_name(english:"GLSA-200703-13 : SSH Communications Security's Secure Shell Server: SFTP privilege escalation"); script_summary(english:"Checks for updated package(s) in /var/db/pkg"); script_set_attribute( attribute:"synopsis", value: "The remote Gentoo host is missing one or more security-related patches." ); script_set_attribute( attribute:"description", value: "The remote host is affected by the vulnerability described in GLSA-200703-13 (SSH Communications Security's Secure Shell Server: SFTP privilege escalation) The SSH Secure Shell Server contains a format string vulnerability in the SFTP code that handles file transfers (scp2 and sftp2). In some situations, this code passes the accessed filename to the system log. During this operation, an unspecified error could allow uncontrolled stack access. Impact : An authenticated system user may be able to exploit this vulnerability to bypass command restrictions, or run commands as another user. Workaround : There is no known workaround at this time." ); script_set_attribute( attribute:"see_also", value:"https://security.gentoo.org/glsa/200703-13" ); script_set_attribute( attribute:"solution", value: "This package is currently masked, there is no upgrade path for the 3.2.x version, and a license must be purchased in order to update to a non-vulnerable version. Because of this, we recommend unmerging this package: # emerge --ask --verbose --unmerge net-misc/ssh" ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:P/I:P/A:P"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:ssh"); script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux"); script_set_attribute(attribute:"patch_publication_date", value:"2007/03/14"); script_set_attribute(attribute:"plugin_publication_date", value:"2007/03/16"); script_set_attribute(attribute:"vuln_publication_date", value:"2006/02/13"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2007-2019 Tenable Network Security, Inc."); script_family(english:"Gentoo Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("qpkg.inc"); if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED); if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo"); if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING); flag = 0; if (qpkg_check(package:"net-misc/ssh", unaffected:make_list(), vulnerable:make_list("lt 4.3.7"))) flag++; if (flag) { if (report_verbosity > 0) security_warning(port:0, extra:qpkg_report_get()); else security_warning(0); exit(0); } else { tested = qpkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "SSH Communications Security's Secure Shell Server"); }
References
- http://marc.info/?l=bugtraq&m=120654385125315&w=2
- http://secunia.com/advisories/18828
- http://secunia.com/advisories/18843
- http://secunia.com/advisories/24516
- http://secunia.com/advisories/29552
- http://security.gentoo.org/glsa/glsa-200703-13.xml
- http://securitytracker.com/id?1015619
- http://support.wrq.com/techdocs/1882.html
- http://www.kb.cert.org/vuls/id/419241
- http://www.securityfocus.com/bid/16625
- http://www.securityfocus.com/bid/16640
- http://www.vupen.com/english/advisories/2006/0554
- http://www.vupen.com/english/advisories/2006/0555
- http://www.vupen.com/english/advisories/2008/1008/references
- https://exchange.xforce.ibmcloud.com/vulnerabilities/24651