what you don't know can hurt you

Core Security Technologies Advisory 2007.1212

Core Security Technologies Advisory 2007.1212
Posted Mar 26, 2008
Authored by Ivan Arce, Core Security Technologies, Oren Isacson, Ariel Waissbein, Pedro Varangot, Martin Mizrahi, Carlos Garcia | Site coresecurity.com

Core Security Technologies Advisory - Secure Internet Life Conferencing (SILC) server versions 1.1.1 and below and client versions 1.1.3 and below suffer from a pkcs_decode related buffer overflow vulnerability.

tags | advisory, overflow
SHA-256 | 13d7d0d17addaf321c63a9614a85b341247fb82af78b25ce1baeaf99a82b0164

Core Security Technologies Advisory 2007.1212

Change Mirror Download
Hash: SHA1

Core Security Technologies - CoreLabs Advisory

SILC pkcs_decode buffer overflow

*Advisory Information*

Title: SILC pkcs_decode buffer overflow
Advisory ID: CORE-2007-1212
Advisory URL: http://www.coresecurity.com/?action=item&id=2206
Date published: 2008-03-25
Date of last update: 2008-03-25
Vendors contacted: SILC development team
Release mode: Coordinated release

*Vulnerability Information*

Class: Arbitrary memory corruption
Remotely Exploitable: Yes
Locally Exploitable: Yes
Bugtraq ID: 28373
CVE Name: N/A

*Vulnerability Description*

Secure Internet Life Conferencing (SILC) is open protocol aimed at
providing encrypted and authenticated communications over an insecure
medium such as the Internet. The SILC application of the same name
implements the protocol as an open source project. SILC is generally
used as a more secure replacement for Internet Relay Chat (IRC) networks
and other open and publicly accessible as well as private instant
messaging networks. A remote buffer overflow vulnerability found in a
library used by both the SILC server and client to process packets
containing cryptographic material may allow an un-authenticated client
to execute arbitrary code on the server with the privileges of the user
account running the server, or a malicious SILC server to compromise
client systems and execute arbitrary code with the privileges of the
user account running the SILC client program.

*Vulnerable Packages*

. SILC server up to 1.1.1
. SILC client up to 1.1.3

*Non-vulnerable Packages*

. SILC server 1.1.2
. SILC client 1.1.4

*Vendor Information, Solutions and Workarounds*

Fixed versions are available at http://silcnet.org/software/download/.


This vulnerability was discovered by Core Security Technologies team
"Los Plomeros vs. Blue Demon" during Bugweek 2007: Ariel Waissbein,
Pedro Varangot, Martin Mizrahi, Oren Isacson, Carlos Garcia and Ivan Arce.

*Technical Description / Proof of Concept Code*

Upon initial connection with a SILC server, mutual authentication
between peers (client, routers and servers) is performed and a key
negotiation protocol is executed to obtain a shared key that is
subsequently used to encrypt communications. While a detailed analysis
of key exchange protocol used by SILC may be appropriate for further
study, what is relevant for the issue at hand is that cryptographic
material is exchanged between peers with data packets encoded using the
PKCS #1 1.5 standard [1].

SILC's PKCS1 encoding functionality is implemented in the 'silccrypt'
library in file 'silcpkcs1.c'. The specific code to decode PKCS#1
packets is implemented in the 'silc_pkcs1_decode' function shown below:


SilcBool silc_pkcs1_decode(SilcPkcs1BlockType bt,
const unsigned char *data,
SilcUInt32 data_len,
unsigned char *dest_data,
SilcUInt32 dest_data_size,
SilcUInt32 *dest_len)
int i = 0;

SILC_LOG_DEBUG(("PKCS#1 decoding, bt %d", bt));

/* Sanity checks */
if (!data || !dest_data || dest_data_size < 3 ||
data[0] != 0x00 || data[1] != (unsigned char)bt) {
SILC_LOG_DEBUG(("Malformed block"));
return FALSE;

/* Decode according to block type */
switch (bt) {
/* Do nothing */

/* Verification */
(1) for (i = 2; i < data_len; i++)
if (data[i] != 0xff)

/* Decryption */
(2) for (i = 2; i < data_len; i++)
if (data[i] == 0x00)

/* Sanity checks */
(3) if (data[i++] != 0x00) {
SILC_LOG_DEBUG(("Malformed block"));
return FALSE;
if (i - 1 < SILC_PKCS1_MIN_PADDING) {
SILC_LOG_DEBUG(("Malformed block"));
return FALSE;
if (dest_data_size < data_len - i) {
SILC_LOG_DEBUG(("Destination buffer too small"));
return FALSE;

/* Copy the data */
(4) memcpy(dest_data, data + i, data_len - i);

/* Return data length */
if (dest_len)
*dest_len = data_len - i;

return TRUE;

- -----------/

In the above code, a maliciously forged data packet with valid PKCS#1
encoding of all bytes set to '0xff' or non-'0x00' when transmitting
private ('BT_PRIV1') or public ('BT_PUB') key material (respectively)
will make the execution flow to exit the loops at '(1)' and '(2)' with
the value of the unsigned integer variable 'i' set to 'data_len'. Next,
at '(3)' the same variable 'i' is incremented by one and thus set to
'data_len+1'. A carefully crafted packet that passes the sanity check in
'(3)' will eventually cause memory corruption due to an integer overflow
in the third argument passed in the 'memcpy()' function call at '(4)'.
Since 'i' is set to 'datalen+1' the 'data_len - i 'expression used to
calculate the value of the third argument (amount of bytes to be copied
from the source buffer) will evaluate to '-1' causing the process memory
to be overwritten due to a Unsigned to Signed conversion error [2].
Exploitation of this vulnerability leads to a direct Denial of Service
to the vulnerable program or to arbitrary code execution on the
vulnerable system with the privileges of the SILC program (either the
client or the server) being attacked.

*Report Timeline*

. 2008-03-19: Initial notification sent to the SILC project.
. 2008-03-20: SILC project team acknowledges the bug and patches their
source tree [3].
. 2008-03-20: Core confirms the SILC project the advisory will be
published on March 25th.


[1] PKCS #1: RSA Encryption Version 1.5
[2] Unsigned to Signed Conversion Error - Common Weakness Enumeration
(CWE) Definition :

*About CoreLabs*

CoreLabs, the research center of Core Security Technologies, is charged
with anticipating the future needs and requirements for information
security technologies. We conduct our research in several important
areas of computer security including system vulnerabilities, cyber
attack planning and simulation, source code auditing, and cryptography.
Our results include problem formalization, identification of
vulnerabilities, novel solutions and prototypes for new technologies.
CoreLabs regularly publishes security advisories, technical papers,
project information and shared software tools for public use at:

*About Core Security Technologies*

Core Security Technologies develops strategic solutions that help
security-conscious organizations worldwide develop and maintain a
proactive process for securing their networks. The company's flagship
product, CORE IMPACT, is the most comprehensive product for performing
enterprise security assurance testing. CORE IMPACT evaluates network,
endpoint and end-user vulnerabilities and identifies what resources are
exposed. It enables organizations to determine if current security
investments are detecting and preventing attacks. Core Security
Technologies augments its leading technology solution with world-class
security consulting services, including penetration testing and software
security auditing. Based in Boston, MA and Buenos Aires, Argentina, Core
Security Technologies can be reached at 617-399-6980 or on the Web at


The contents of this advisory are copyright (c) 2008 Core Security
Technologies and (c) 2008 CoreLabs, and may be distributed freely
provided that no fee is charged for this distribution and proper credit
is given.

*GPG/PGP Keys*

This advisory has been signed with the GPG key of Core Security
Technologies advisories team, which is available for download at

Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Login or Register to add favorites

File Archive:

May 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    0 Files
  • 2
    May 2nd
    15 Files
  • 3
    May 3rd
    19 Files
  • 4
    May 4th
    24 Files
  • 5
    May 5th
    15 Files
  • 6
    May 6th
    14 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    13 Files
  • 10
    May 10th
    7 Files
  • 11
    May 11th
    99 Files
  • 12
    May 12th
    45 Files
  • 13
    May 13th
    7 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    26 Files
  • 18
    May 18th
    4 Files
  • 19
    May 19th
    17 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    6 Files
  • 24
    May 24th
    19 Files
  • 25
    May 25th
    5 Files
  • 26
    May 26th
    12 Files
  • 27
    May 27th
    12 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2022 Packet Storm. All rights reserved.

Security Services
Hosting By