{"exploit":{"id":"EDB-15293","name":"LibSMI smiGetNode - Buffer Overflow When Long OID Is Given in Numerical Form","description":"LibSMI smiGetNode - Buffer Overflow When Long OID Is Given in Numerical Form","cves":["CVE-2010-2891"],"author":"Core Security","published":"2010-10-20","platform":"linux","type":"dos","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/15293","path":"exploits/linux/dos/15293.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-15293.txt","vulnerabilities":[{"id":"CVE-2010-2891","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in the smiGetNode function in lib/smi.c in libsmi 0.4.8 allows context-dependent attackers to execute arbitrary code via an Object Identifier (aka OID) represented as a numerical string containing many components separated by . (dot) characters.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2010-2891","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2010-2891"},"updatedAt":"2024-08-07T02:46:48.572Z","retrievedAt":"2026-11-27T03:06:20.119Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-15293.png?v=2","url":"https://exploitbin.com/exploits/EDB-15293","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-15293/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-15293/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n                Core Security Technologies - CoreLabs Advisory\n                            http://corelabs.coresecurity.com/\n\nLibSMI smiGetNode Buffer Overflow When Long OID Is Given In Numerical Form\n\n\n1. *Advisory Information*\n\nTitle: LibSMI smiGetNode Buffer Overflow When Long OID Is Given In\nNumerical Form\nAdvisory Id: CORE-2010-0819\nAdvisory URL:\nhttp://www.coresecurity.com/content/libsmi-smigetnode-buffer-overflow\nDate published: 2010-10-20\nDate of last update: 2010-10-20\nVendors contacted: Libsmi team\nRelease mode: Coordinated release\n\n\n2. *Vulnerability Information*\n\nClass: Failure to Constrain Operations within the Bounds of a Memory\nBuffer [CWE-119]\nImpact: Code execution\nRemotely Exploitable: Yes\nLocally Exploitable: Yes\nCVE Name: CVE-2010-2891\nBugtraq ID: N/A\n\n\n3. *Vulnerability Description*\n\nA statically allocated buffer is overwritter in the case that a very\nlong Object Identifier is specified in stringified dotted notation to\nthe smiGetNode function of libsmi[1]. This may result in arbitraty\ncode execution by cleverly overwriting key pointers in memory.\n\n\n4. *Vulnerable packages*\n\n   . libsmi 0.4.8.\n   . Any software that uses the vulnerable function to find a\ndefinition from an Object Indentifier specified in stringified dotted\nnotation that is given by the user. The SNMP packets from the protocol\nthat travel over the network do not use this notation for OIDs.\n\n\n5. *Non-vulnerable packages*\n\n   . libsmi 0.4.8 patched with the supplied patch.\n   . Any future release of libsmi, or current SVN head revision, since\nthis patch was already commited to their repositories.\n\n\n6. *Vendor Information, Solutions and Workarounds*\n\nThis patch was supplied by Juergen Schoenwaelder and fixes the bug:\n\n/-----\nIndex: lib/smi.c\n===================================================================\n- --- lib/smi.c    (revision 29144)\n+++ lib/smi.c    (working copy)\n@@ -1793,10 +1793,15 @@\n     }\n\n     if (isdigit((int)node2[0])) {\n- -    for (oidlen = 0, p = strtok(node2, \". \"); p;\n+    for (oidlen = 0, p = strtok(node2, \". \");\n+         p && oidlen < sizeof(oid)/sizeof(oid[0]);\n          oidlen++, p = strtok(NULL, \". \")) {\n         oid[oidlen] = strtoul(p, NULL, 0);\n     }\n+    if (p) {\n+        /* the numeric OID is too long */\n+        return NULL;\n+    }\n     nodePtr = getNode(oidlen, oid);\n     if (nodePtr) {\n         if (modulePtr) {\n- -----/\n\n\n7. *Credits*\n\nThis vulnerability was discovered and researched by Andrés López\nLuksenberg\n[http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=researcher&name=Andres_Lopez_Luksenberg]\nfrom Core Security Technologies. The publication of this advisory was\ncoordinated by Pedro Varangot\n[http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=researcher&name=Pedro_Varangot].\n\n\n\n8. *Technical Description / Proof of Concept Code*\n\nThe 'smiGetNode' function returns a 'SmiNode' struct given the name of\na OID as a 'char *' in both either numeric (i.e. \"1.3.6.1.2.1.4.17\")\nor human readable format (i.e. \"ipForwarding\"). This function uses a\nstatic array of 128 elements of type 'unsigned int' to hold the OID in\nnumeric format:\n\n/-----\n    SmiSubid        oid[128];\n- -----/\n Note that 'SmiSubid' is a 'typedef' of 'unsigned int'.\n\nThis array is populated by a loop that calls 'strtok' and then\nsubsecuently 'strtoul' in the case that the OID supplied as a 'char *'\nwas in the form of subsecuent numbers separated by a period.\n\n/-----\n    if (isdigit((int)node2[0])) {\n      for (oidlen = 0, p = strtok(node2, \". \"); p;\n            oidlen++, p = strtok(NULL, \". \")) {\n        oid[oidlen] = strtoul(p, NULL, 0);\n      }\n    }\n- -----/\n That loop clearly overwrites past 'oid' boundaries when the string\ncontained in 'node2' has more that 128 dots (\".\"). This constitutes a\nclassical overflow that can likely be leveraged into arbitrary code\nexecution reliably.\n\nTo verify if the version on 'libsmi' installed on a unix based system\nis vulnerable, the code example (smisubtree) from 'man libsmi'[2] can\nbe used. This programs calls 'smiGetNode' in the following way in line\n17:\n\n/-----\n    for((smiNode = smiGetNode(NULL, argv[1])) &&}\n- -----/\n The program crashes when called via commandline with an OID with more\nthan 128 numeric tokens, like the OID outputed by the following Python\nscript:\n\n/-----\n    #!/usr/bin/python\n\n    # run ./smisubtree `./libsmicrash.py`\n\n    if __name__ == \"__main__\":\n            s = \"\"\n            for i in xrange(158):\n                    s = s + \"1.\"\n\n            print s}\n- -----/\n\n\n9. *Report Timeline*\n\n. 2010-09-06:\nCore Security Technologies contacts Vincent Bernat, the Debian Package\nMaintainer for libsmi, informing that a bug has been found in libsmi.\nCore Security Technologies asks for a security contact in upstream\nstating that finding a reliable one using Google or looking at mailing\nlists was difficult.\n\n. 2010-09-06:\nVincent Bernat, the Debian Package Maintainer for libsmi, replies with\ntwo e-mail of aledged developers of libsmi, Juergen Schoenwaelder and\nFrank Strauss.\n\n. 2010-09-07:\nCore Security Technologies contacts Juergen Schoenwaelder and Frank\nStrauss at their supplies e-mail addresses, telling about a found\nvulnerability and offering an advisory draft in either plain or\nencripted form.\n\n. 2010-09-07:\nFrank Strauss' e-mail address bounces Core Security Technologies'\ne-mail back, informing about a new e-mail address. Core Security\nTechnologies sends the message again to the new address.\n\n. 2010-09-07:\nJuergen Schoenwaelder replies with his PGP keys, and copies Vincent\nBernat again in the conversation.\n\n. 2010-09-09:\nCore Security Technologies sends and encripted draft of this advisory\nto Juergen Schoenwaelder and Vincent Bernat, with apologies due to the\ndelay caused by Pedro Varangot\n[http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=researcher&name=Pedro_Varangot]\nbeing on leave due to health issues. The advisory draft mentions\nNet-SNMP as possible vulnerabile software.\n\n. 2010-09-11:\nJuergen Schoenwaelder replies with a patch fixing the vulnerability,\nand correcting some tecnical information in the advisory draft\nregarding the impact of the vulnerability, stating that it is likely\nlow and that Net-SNMP is not affected.\n\n. 2010-09-27:\nCore Security Technologies replies to Juergen Schoenwaelder and\nVincent Bernat agreeing that the impact of the vulnerability is low\nand removes the mention of Net-SNMP in the avisory. Core Security\nTechnologies asks for a timeline regarding the release of a fixed\nversion of libsmi stating that this advisory will be released anyway,\nbecause someone may be using libsmi in his software introducing a\nvulnerability he may not know about. No reply is received for this\ne-mail.\n\n. 2010-10-04:\nCore Security Technologies notifies Juergen Schoenwaelder and Vincent\nBernat that October the 18th has been set as a tentative release date\nfor this advisory, and that the release date is open to discussion if\ncommitment to release a fixed version of libsmi in a given timeframe\nis given.\n\n. 2010-10-08:\nJuergen Schoenwaelder replies with sugestions for the vulnerable\npackages and vendor information section of this advisory. He also\nmentions that Core Security Technologies should go with the October de\n18th release date for this advisory.\n\n. 2010-10-08:\nCore Security Technologies incorporates Juergen Schoenwaelder's\nsuggestions to the advisory, and again mentions that the advisory can\nbe rescheduled if it is deemed necesary by the vendor.\n\n. 2010-10-20:\nAdvisory CORE-2010-0819 is released.\n\n\n10. *References*\n\n[1] [http://www.ibr.cs.tu-bs.de/projects/libsmi/]\n[2] [http://www.ibr.cs.tu-bs.de/projects/libsmi/libsmi.html]\n\n\n11. *About CoreLabs*\n\nCoreLabs, the research center of Core Security Technologies, is\ncharged with anticipating the future needs and requirements for\ninformation security technologies. We conduct our research in several\nimportant areas of computer security including system vulnerabilities,\ncyber attack planning and simulation, source code auditing, and\ncryptography. Our results include problem formalization,\nidentification of vulnerabilities, novel solutions and prototypes for\nnew technologies. CoreLabs regularly publishes security advisories,\ntechnical papers, project information and shared software tools for\npublic use at: [http://corelabs.coresecurity.com/].\n\n\n12. *About Core Security Technologies*\n\nCore Security Technologies develops strategic solutions that help\nsecurity-conscious organizations worldwide develop and maintain a\nproactive process for securing their networks. The company's flagship\nproduct, CORE IMPACT, is the most comprehensive product for performing\nenterprise security assurance testing. CORE IMPACT evaluates network,\nendpoint and end-user vulnerabilities and identifies what resources\nare exposed. It enables organizations to determine if current security\ninvestments are detecting and preventing attacks. Core Security\nTechnologies augments its leading technology solution with world-class\nsecurity consulting services, including penetration testing and\nsoftware security auditing. Based in Boston, MA and Buenos Aires,\nArgentina, Core Security Technologies can be reached at 617-399-6980\nor on the Web at [http://www.coresecurity.com].\n\n\n13. *Disclaimer*\n\nThe contents of this advisory are copyright (c) 2010 Core Security\nTechnologies and (c) 2010 CoreLabs, and are licensed under a Creative\nCommons Attribution Non-Commercial Share-Alike 3.0 (United States)\nLicense: [http://creativecommons.org/licenses/by-nc-sa/3.0/us/]\n\n\n14. *PGP/GPG Keys*\n\nThis advisory has been signed with the GPG key of Core Security\nTechnologies advisories team, which is available for download at\n[http://www.coresecurity.com/files/attachments/core_security_advisories.asc].\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (MingW32)\nComment: GnuPT v3.6.3\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAky/P9oACgkQyNibggitWa0K3gCgoQyq4J1uKs2NadmnaKqQ14sB\nScYAnRyR1Gs5APN0CDENMjOLMJwXdPt2\n=35zG\n-----END PGP SIGNATURE-----","sha256":"ad545fd14ee52f6cc0847ff81e9a8d137bc2de75afc7c07bffc09fadd2941793","bytes":10107,"fetchedAt":"2026-11-27T03:06:18.411Z","encoding":"utf-8 (display only; download retains original bytes)"}