The present invention relates to a vulnerability finding device, a vulnerability finding method, and a vulnerability finding program.
Conventionally mentioned as one of factors of cyber attacks and infection with malware is the presence of vulnerability in software. Vulnerability is bugs that third parties are able to use in malicious acts, from bugs present in software. Thus, countermeasures, such as software developers finding and correcting vulnerability earlier than attackers, are becoming increasingly important. One of methods of finding vulnerability present in software is a method of using code clones. Code clones are similar or matching pieces of programs present in software. Code clones are usually generated by a software developer copying and pasting a source code into a program under development in order to realize particular functions, the source code being of another program having similar functions.
For example, if vulnerability is found in a source code of a copy source, a software developer not only needs to correct the source code of the copy source, but also needs to correct a source code of a copy destination. However, even if vulnerability is found in the source code of the copy source, unless the developer knows all of code clones of the found vulnerability, correction of vulnerability in software developed by use of the code clones is difficult. A method of finding vulnerability by use of code clones is a method of finding unknown vulnerability present in software to be inspected by finding a code clone of a part found to be vulnerable in the software to be inspected.
For example, described in Non-Patent Literature 1 is a method of using a technique for detecting a code clone included in a source code in finding vulnerability in software. Specifically, in this method, a source code of a vulnerable part is extracted from software found to have vulnerability in the past, and a code clone of the vulnerable part is found by performing matching between pieces of that source code with a source code of software to be inspected, the code clone included in the software to be inspected. In Non-Patent Literature 2, a technique for detecting code clones is described, the technique targeting a program code obtained from an executable file format.
Non-Patent Literature 1: J. Jang, A. Agrawal, and D. Brumley, “ReDeBug: Finding Unpatched Code Clones in Entire OS Distributions”, In IEEE Symposium on Security and Privacy, 2012
Non-Patent Literature 2: Andreas Saebjoernsen, Jeremiah Willcok, Thomas Panas, Daniel Quinlan, and Zhendong Su, “Detecting Code Clones in Binary Executables”, In Proceedings of ISSTA '09, 2009
However, a technique for finding vulnerability by use of code clones, with a program code of software being a target to be inspected, has not existed. In other words, for a software developer to find vulnerability of software by use of code clones, the software developer needs to know a source code of software to be inspected. Therefore, as to software, for which a source code is difficult to be obtained or used (for example, privately owned software, or software set with exclusive rights), finding vulnerability thereof has been difficult.
Techniques disclosed herein have been made in view of the above, and an object thereof is to provide a vulnerability finding device, a vulnerability finding method, and a vulnerability finding program, which enable vulnerability of software to be found without use of a source code.
To solve the problems described above and achieve the object, a vulnerability finding device, comprising: an extracting unit that extracts a first program code corresponding to a vulnerable part of software; a normalization unit that performs normalization of a parameter included in the first program code extracted by the extracting unit and a second program code of software to be inspected for a vulnerable part; and a detecting unit that performs matching between the first program code after the normalization and the second program code after the normalization, and detects a program code that is the same as or similar to the first program code, from the second program code.
Further, a vulnerability finding method executed by a vulnerability finding device, the vulnerability finding method including: an extracting process of extracting a first program code corresponding to a vulnerable part of software; a normalization process of performing normalization of a parameter included in the first program code extracted by the extracting process and a second program code of software to be inspected for a vulnerable part; and a detecting process of performing matching between the first program code after the normalization and the second program code after the normalization, and detecting a program code that is the same as or similar to the first program code, from the second program code.
Further, a vulnerability finding program for causing a computer to execute: an extracting step of extracting a first program code corresponding to a vulnerable part of software; a normalization step of performing normalization of a parameter included in the first program code extracted by the extracting step and a second program code of software to be inspected for a vulnerable part; and a detecting step of performing matching between the first program code after the normalization and the second program code after the normalization, and detecting a program code that is the same as or similar to the first program code, from the second program code.
A vulnerability finding device, a vulnerability finding method, and a vulnerability finding program, which are disclosed by the present application, have an effect of enabling vulnerability of software to be found without use of a source code.
Hereinafter, embodiments of a vulnerability finding device, a vulnerability finding method, and a vulnerability finding program, which are disclosed by the present application, will be described in detail with reference to the drawings. The vulnerability finding device, the vulnerability finding method, and the vulnerability finding program disclosed by the present application are not limited by the following embodiments.
First of all, a configuration of a vulnerability finding device 10 according to an embodiment disclosed by the present application will be described.
The vulnerability related DB 11 stores therein vulnerability related information. The vulnerability related information is, for example, attack verification codes, Common Vulnerabilities and Exposures (CVE), or the like, which will described later. The vulnerability extracting unit 12 obtains the vulnerability related information from the vulnerability related DB 11, and based on the vulnerability related information, extracts, from software, in which vulnerability is present, a program code corresponding to a part of that vulnerability.
The disassembling unit 13 disassembles inspection target software S1. The normalization processing unit 14 obtains a program code 12a of the vulnerable part from the vulnerability extracting unit 12. The normalization processing unit 14 obtains a result of the disassembling of the inspection target software S1 (assembly code) 13a from the disassembling unit 13. The normalization processing unit 14 performs normalization of the program code 12a of the vulnerable part and the result of the disassembling of the inspection target software S1.
The matching unit 15 performs matching (collation) between a program code 12b of the vulnerable part after the normalization and a program code 13b of the inspection target software S1 after the normalization, and finds a code clone of the program code 12b, the code clone included in the program code 13b. The matching unit 15 extracts, as an unknown vulnerability candidate, information on the code clone obtained as a result of the matching, and causes the information to be stored in the vulnerability candidate DB 16.
Next, operation of the vulnerability finding device 10 will be described.
Specifically, when the security patches D1 of the vulnerability related information are used, the vulnerability extracting unit 12 extracts a part of an application range of the security patches D1 with respect to the software, in which vulnerability is present, as the program code of the vulnerable part (E1). Further, when the attack verification codes D2 of the vulnerability related information are used, the vulnerability extracting unit 12 executes the attack verification codes D2 for the software, in which vulnerability is present, and extracts, as the program code of the vulnerable part, a part that becomes a starting point of attack (E2). Or, when the Common Vulnerabilities and Exposures D3 of the vulnerability related information are used, the vulnerability extracting unit 12 refers to a Common Vulnerabilities and Exposures Data Base (CVEDB) and extracts, as the program code of the vulnerable part, a part identified based on information on the software, in which vulnerability has been found (E3).
As described above, if a software developer is unable to obtain a source code of the software, in which vulnerability is present, and only an executable file in a binary format (program code) is present, as illustrated with a solid lined arrow Y1 in
The vulnerability extracting unit 12 may use compile options C11, C12, . . . upon compilation with the compiler C1. Similarly, the vulnerability extracting unit 12 may use compile options C21, C22, . . . and compile options C31, C32, . . . upon compilation with the compilers C2 and C3, respectively.
Next, the disassembling unit 13 reads the inspection target software S1 and outputs a code that has been disassembled. The normalization processing unit 14 performs normalization processing of the program code of the vulnerable part that is a matching source and the disassembled program code of the inspection target software S1 that is a matching destination, and outputs the normalized program codes.
In more detail, for software, the program codes generated may change even if the source codes are the same, depending on the environments in which the compilation has been performed (for example, the compilers or the compile options). Therefore, even if a code clone of a vulnerable part is present in the inspection target software S1 on the source code level, depending on the compilation environment, the above described parameter used by the program code may change. In this case, unless the vulnerability finding device 10 performs the above described normalization processing, the program code part that is rightfully the code clone may be misrecognized as a different program code part. As a result, vulnerability in the inspection target software S1 may be overlooked. Thus, by performing the above described normalization processing, the vulnerability finding device 10 increases adaptability to change in the compilation environment and realizes accurate code clone search with program codes without use of source codes.
In the normalization processing, a contracted instruction, which is information excluding the operand part from a machine instruction, may be used.
The matching unit 15 performs matching between the program code of the vulnerable part and the program code of the inspection target software S1, and extracts, as an unknown vulnerability candidate, information on a code clone found by the matching. The extracted information is stored in the vulnerability candidate DB 16. The information extracted and stored by the matching unit 15 may be the code clone itself, or attribute information of the code clone (for example, the position, the size, and the like).
For example, in an example illustrated in
The above described identity determination for architecture and executable file formats does not necessarily require a match for both, and only one of them may match.
After selecting a program code of a vulnerable part having the same architecture and executable file format as the inspection target, the matching unit 15 performs comprehensive matching between the program code of the inspection target software S1 and the program code of the vulnerable part. That is, the matching unit 15 performs the matching, as illustrated in
The matching unit 15 may calculate, upon the matching, a similarity indicating how similar the program code (matching source) of the vulnerable part and the program code (matching destination) of the inspection target software S1 are. In this case, the matching unit 15 determines that the program code part is a code clone part in the inspection target software S1, the program code part having a similarity, which is the highest and exceeds a predetermined threshold, the similarity obtained as a result of the matching. For example, the matching unit 15 calculates the similarities while shifting a matching target of the program code of the inspection target software S downward, by using N-perms. Specifically, the matching unit 15 calculates the similarity, like, the similarity being “25%” when one line out of four lines matches, or the similarity being “10%” when one line out of ten lines matches. If a program code part that is at a position where the calculated similarity is the highest (the position of “95%” in
Although the above mentioned N-perms is a similarity calculation technique using N series-by-instruction without ordering, since this technique is a widely known technique described in a reference, “Karim, M. E., Walenstein, A., Lakhotia, A., and Parida, L., “Malware Phylogeny Generation using Permutations of Code”, European Research Journal of Computer Virology 1, 1-2 (November, 2005) 13-23”, detailed description thereof will be omitted. Although a program code part with a similarity being the highest and exceeding the predetermined threshold has been described as an example with respect to the conditions of the similarity, not being limited to this example, any other conditions may be adopted, like a program code part satisfying any one of these conditions, a program code part having a similarity within the top three similarities, or the like.
As described above, the vulnerability finding device 10 is able to further reduce misdetection of code clones by using the above described similarity upon matching between a program code of a vulnerable part and the program code of the inspection target software S1. As a result, accuracy of finding vulnerability is improved.
As described above, the vulnerability finding device 10 has the vulnerability extracting unit 12, the normalization processing unit 14, and the matching unit 15. The vulnerability extracting unit 12 extracts a first program code corresponding to a vulnerable part of software. The normalization processing unit 14 performs normalization of a parameter that differs according to the compilation environment, the parameter included in the first program code extracted by the vulnerability extracting unit 12 and in a second program code of software to be inspected for a vulnerable part. The matching unit 15 performs matching between the first program code after the normalization and the second program code after the normalization, and detects, as an unknown vulnerability candidate, a code clone, which is a program code that is the same as or similar to the first program code, from the second program code.
Further, in the vulnerability finding device 10, upon the matching, the matching unit 15 may perform matching between: the first program code after the normalization, the first program code having the same architecture and executable file format as those of the software to be inspected; and the second program code after the normalization. Furthermore, the vulnerability extracting unit 12 may compile a source code of software having the first program code, and extract the first program code corresponding to the vulnerable part of the software from the program code obtained by the compilation. Moreover, the matching unit 15 may calculate a similarity between the first program code and the second program code, and detect a program code having the similarity, which is the highest and exceeds a predetermined value, from the second program code, as the above described same or similar program code. In addition, the normalization processing unit 14 may perform normalization of a parameter, as the above described parameter, the parameter changing according to the compilation environment, from parameters included in both of program codes of the first program code and the second program code.
As described above, the vulnerability finding device 10 is able to find vulnerability generated by a code clone in the inspection target software S1 without using a source code of the inspection target software S1, by directly comparing program codes. Therefore, finding vulnerability in software, for which a source code is difficult to be obtained or used (for example, privately owned software, or software set with exclusive rights), is also enabled.
(Vulnerability Finding Program)
The memory 101 includes, as illustrated in
As illustrated in
The program module 108c and the program data 108d related to the vulnerability finding program are not necessarily stored in the hard disk drive 108, and for example, may be stored in an attachable and detachable storage medium and read out by the CPU 102 via the disk drive 109 or the like. Or, the program module 108c or the program data 108d related to the vulnerability finding program may be stored in another computer connected via a network (local area network (LAN), wide area network (WAN), or the like) and read out by the CPU 102 via the network interface 107.
In the above described embodiment, the disassembling unit 13 disassembles the inspection target software S1, but if the inspection target software S1 is described in a high level language, decompilation may be performed. On the contrary, in
Further, each of the above described components of the vulnerability finding device 10 is not necessarily physically configured as illustrated in the drawings. That is, specific modes of distribution and integration of the respective devices are not limited to those illustrated in the drawings, and depending on various loads, use situations and the like, all or some of the devices may be configured to be functionally or physically distributed or integrated in arbitrary units. For example, at least one of: the vulnerability extracting unit 12 and normalization processing unit 14; and the disassembling unit 13 and normalization processing unit 14, may be integrated into one component. On the contrary, the matching unit 15 may be distributed into a unit that executes matching processing, a unit that detects a code clone, and a unit that determines identity of the used architecture and executable file format. Furthermore, the hard disk drive 108 may be connected via a network or cable, as an external device of the vulnerability finding device 10.
Number | Date | Country | Kind |
---|---|---|---|
2014-167678 | Aug 2014 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2015/071721 | 7/30/2015 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2016/027641 | 2/25/2016 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6282698 | Baker et al. | Aug 2001 | B1 |
20090313700 | Horne | Dec 2009 | A1 |
20100011441 | Christodorescu | Jan 2010 | A1 |
20130185798 | Saunders et al. | Jul 2013 | A1 |
20130227693 | Dewey | Aug 2013 | A1 |
20130239219 | Siman | Sep 2013 | A1 |
20150058984 | Shen | Feb 2015 | A1 |
20150242626 | Wang | Aug 2015 | A1 |
Number | Date | Country |
---|---|---|
101425035 | May 2009 | CN |
2009-98851 | May 2009 | JP |
Entry |
---|
Extended European Search Report dated Dec. 5, 2017 in Patent Application No. 15833502.6. |
Debin Gao, et al., “BinHunt: Automatically Finding Semantic Differences in Binary Programs”, Network and Parallel Computing, Springer International Publishing, XP47403742A, 2008, pp. 238-255. |
International Search Report dated Oct. 27, 2015, in PCT/JP2015/071721, filed Jul. 30, 2015. |
Jang et al., “ReDeBug: Finding Unpatched Code Clones in Entire OS Distributions”, 2012 IEEE Symposium on Security and Privacy, 2012, pp. 48-62. |
Saebjornsen et al., “Detecting Code Clones in Binary Executables”, Proceedings of ISSTA '09, 2009, pp. 1-11. |
Jing et al., “Proposal of Access Control System for Preventing Attacks Exploiting Vulnerability in Android WebView”, IPSJ SIG Technical Report, vol. 2013-CSEC-60, No. 4, Apr. 15, 2013, 27 pages, with partial English translation. |
Zhang et al., “MetaAware: Identifying Metamorphic Malware”, Proceedings Twenty-Third Annual Computer Security Applications Conference, Dec. 10-14, 2007, pp. 411-420. |
Ding et al., “Identifying Buffer Overflow Vulnerabilities based on Binary Code”, Proceedings 2011 IEEE International Conference on Computer Science and Automation Engineering, vol. 4, Jun. 10-12, 2011, pp. 738-742. |
Chinese Office Action for CN 201580042817.8, dated Oct. 19, 2018 (English translation provided). |
Number | Date | Country | |
---|---|---|---|
20170286692 A1 | Oct 2017 | US |