JP4587976B2 - Application vulnerability inspection method and apparatus - Google Patents

Application vulnerability inspection method and apparatus Download PDF

Info

Publication number
JP4587976B2
JP4587976B2 JP2006050560A JP2006050560A JP4587976B2 JP 4587976 B2 JP4587976 B2 JP 4587976B2 JP 2006050560 A JP2006050560 A JP 2006050560A JP 2006050560 A JP2006050560 A JP 2006050560A JP 4587976 B2 JP4587976 B2 JP 4587976B2
Authority
JP
Japan
Prior art keywords
data
inspection
vulnerability
application
vulnerable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006050560A
Other languages
Japanese (ja)
Other versions
JP2007233432A (en
Inventor
伸之 大浜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2006050560A priority Critical patent/JP4587976B2/en
Publication of JP2007233432A publication Critical patent/JP2007233432A/en
Application granted granted Critical
Publication of JP4587976B2 publication Critical patent/JP4587976B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、Webアプリケーションなどのアプリケーションを検査し、そのソースコード内に含まれる脆弱性が生じる箇所を検出するとともにプログラマの脆弱性の修正作業を支援する情報を提供するアプリケーションの脆弱性検査装置に関するものである。   The present invention relates to an application vulnerability inspection apparatus that inspects an application such as a Web application, detects a location where a vulnerability is included in the source code, and provides information that supports a vulnerability correction work of a programmer. Is.

一般に、ソフトウェア(アプリケーション)に含まれる脆弱性を検査する方法には、稼動中のソフトウェアを調べる方法と、ソフトウェアのソースコードを静的に調べる方法の2つがある。
稼動中のソフトウェアの検査手法は、動作するソフトウェアに様々なデータを入力し、それに対する結果を元に脆弱性が含まれているかどうかを判断するものである。
例えばOWASPで公開されているWebScarabのManual Interceptプラグインを利用した検査が挙げられる。
In general, there are two methods for inspecting vulnerabilities included in software (applications): a method for examining software in operation and a method for statically examining a source code of software.
The software inspection method in operation is to input various data into the operating software and determine whether or not a vulnerability is included based on the result.
For example, the inspection using the Manual Intercept plug-in of WebScarab published by OWASP.

一方、静的なソフトウェアの検査手法とは、ソースコードを検査し、プログラミング言語の標準ライブラリなどに含まれる「危険なメソッド」の使用箇所を検出するものである。「危険なメソッド」とは、プログラマがその使用に注意しないとソフトウェアに脆弱性を生じさせるメソッドのことである。
静的検査方法については、下記の非特許文献1の2章に詳しく述べられている。
On the other hand, the static software inspection method is to inspect the source code and detect the use place of the “dangerous method” included in the standard library of the programming language. A “dangerous method” is a method that creates a vulnerability in software if the programmer is not careful about its use.
The static inspection method is described in detail in Chapter 2 of Non-Patent Document 1 below.

情報処理振興事業協会セキュリティセンター:オープンソース・ソフトウェアのセキュリティ確保に関する調査報告書 第2部 オープンソース・ソフトウェアの効率的な検査技術の調査:平成15年2月Information processing promotion business association security center: Investigation report about security assurance of open source software Part 2 Investigation of efficient inspection technology of open source software: February 2003

ソフトウェアがソフトウェア外部から取得した文字列データを「危険なメソッド」で処理する場合、脆弱性となる。この脆弱性の例として、OSコマンド挿入脆弱性やSQLコマンド挿入脆弱性、クロスサイトスクリプティング脆弱性などがある。
このような脆弱性を含むソースコードの検査を従来の静的検査方法で行った場合、脆弱な可能性のある箇所を検出できるものの、具体的にどこから外部データが入力され、どのメソッドを経由して脆弱となる可能性のあるメソッドに渡されるのかについての情報を提供する技術はない。そのため、プログラマが目視して本当に脆弱性であるかの判断をする場合や脆弱性の対策を行う場合にかかる作業工数が多いという問題がある。
また、実際に脆弱性が生じる場合と、脆弱性ではないものの該当箇所以外のコードを少し変更しただけで脆弱性となってしまう場合(潜在的な脆弱性)の区別がなされず同じように出力されるため、対策を行うための優先度順位を付けられない。そのため、効果的な対策を実施することができないという問題がある。
When software processes character string data acquired from outside the software with a "dangerous method", it becomes a vulnerability. Examples of this vulnerability include OS command insertion vulnerability, SQL command insertion vulnerability, and cross-site scripting vulnerability.
When the source code that contains such vulnerabilities is inspected by the conventional static inspection method, it is possible to detect the location where there is a possibility of vulnerability, but specifically, from where the external data is input and through which method There is no technology that provides information about what is passed to a potentially vulnerable method. Therefore, there is a problem that a lot of work man-hours are required when the programmer visually determines whether or not the vulnerability is true or when countermeasures for the vulnerability are taken.
Also, if the vulnerability actually occurs and if it is not a vulnerability but it becomes a vulnerability by changing a code other than the corresponding part a little (potential vulnerability), the same output is made. Therefore, the priority order for taking measures cannot be set. Therefore, there is a problem that effective measures cannot be implemented.

一方、従来の動的検査方法で検査を行った場合、上述の潜在的な脆弱性は検出されない。ソースコード内での脆弱性の原因となるコードの場所が指摘されない。また、Webアプリケーションに対して送信されるリクエストデータに含まれるパラメータおよびヘッダフィールドのうち、どの値がWebアプリケーションのソースコード内で利用されているか分からないため、すべてのパラメータおよびヘッダフィールドについて、擬似的な攻撃コードを設定して検査する必要がある。   On the other hand, when the inspection is performed by the conventional dynamic inspection method, the above-described potential vulnerability is not detected. The location of the code that causes the vulnerability in the source code is not pointed out. In addition, since it is not known which value is used in the source code of the Web application among the parameters and header fields included in the request data transmitted to the Web application, all parameters and header fields are simulated. It is necessary to set and inspect a proper attack code.

本発明の目的は、プログラマに対し脆弱な遷移を伴うメソッド呼び出し箇所だけでなく、外部入力データ箇所および該データが経由するメソッドの情報を提供し、脆弱性の判断および対策に要する作業量を軽減すること、および脆弱な箇所以外に現状では脆弱ではないが該当箇所以外のコードを少し変更しただけで脆弱となってしまう潜在的に脆弱な箇所も検出すること、および該脆弱な箇所と該潜在的に脆弱な箇所を区別して検出し、プログラマが危険度の高いものから順番に効果的に対策を行えるようにすることができるアプリケーションの脆弱性検査方法及び装置を提供することにある。   The object of the present invention is to provide not only the method call location with a fragile transition to the programmer, but also information on the external input data location and the method through which the data passes, reducing the amount of work required for vulnerability determination and countermeasures And detecting potentially vulnerable areas that are not vulnerable at present but become vulnerable with only minor changes to the code other than the relevant areas, and the vulnerable areas and the latent areas. It is an object of the present invention to provide a vulnerability inspection method and apparatus for an application that can detect and detect a particularly vulnerable portion so that a programmer can effectively take countermeasures in descending order of risk.

上記目的を達成するために、本発明に係るアプリケーションの脆弱性検査方法は、アプリケーション検査管理手段からの検査開始通知を受け、検査対象のアプリケーションのソースコードについて、ソースコード外部からのデータをその入力箇所ごとに区別し、変数の参照する値およびメソッドによる遷移を解析することで脆弱性の検査を行い、脆弱性の可能性のあるコードの位置およびその原因となるアプリケーション外部からのデータの入力位置と該データが経由するメソッドの情報を取得する第1のステップと、前記第1のステップで検出した箇所について、アプリケーション供給手段が供給する検査対象アプリケーションに対し、検査のためのリクエストデータを送付し、そのレスポンスデータ及び予め登録している脆弱性判定コードと比較することにより、脆弱性が含まれるかどうかを判定し、脆弱であるものと、そうでないものを区別して出力する第2のステップを備えることを特徴とする。   In order to achieve the above object, an application vulnerability inspection method according to the present invention receives an inspection start notification from an application inspection management unit, and inputs data from outside the source code for the source code of the application to be inspected. The location of the code that may be vulnerable and the input position of the data from the outside of the application that causes the vulnerability are checked by analyzing the transition by the value and method referenced by the variable, distinguishing each location And a first step of acquiring information of a method through which the data passes, and a request data for inspection is sent to the inspection target application supplied by the application supply means for the part detected in the first step. , Its response data and pre-registered vulnerability judgment code And by comparing, to determine if it contains a vulnerability, characterized as a brittle, further comprising a second step of outputting to distinguish not.

また、本発明に係るアプリケーションの脆弱性検査装置は、アプリケーション検査管理手段からの検査開始通知を受け、検査対象のアプリケーションのソースコードについて、ソースコード外部からのデータをその入力箇所ごとに区別し、変数の参照する値およびメソッドによる遷移を解析することで脆弱性の検査を行い、脆弱性の可能性のあるコードの位置およびその原因となるアプリケーション外部からのデータの入力位置と該データが経由するメソッドの情報を取得する第1の手段と、前記第1の手段で検出した箇所について、アプリケーション供給手段が供給する検査対象アプリケーションに対し、検査のためのリクエストデータを送付し、そのレスポンスデータ及び予め登録している脆弱性判定コードと比較することにより、脆弱性が含まれるかどうかを判定し、脆弱であるものと、そうでないものを区別して出力する第2の手段を備えることを特徴とする。   In addition, the application vulnerability inspection apparatus according to the present invention receives an inspection start notification from the application inspection management means, and for the source code of the inspection target application, distinguishes data from outside the source code for each input location, Analyzes the values referenced by variables and transitions by methods to check for vulnerabilities, and the location of code that may be vulnerable and the input location of data from the outside of the application and the data pass Request data for inspection is sent to the inspection target application supplied by the application supply means for the first means for acquiring method information and the location detected by the first means, and the response data and Vulnerability by comparing with registered vulnerability judgment code To determine if it contains, it characterized as a brittle, further comprising a second means for the distinguished outputs are not.

本発明によれば、プログラマに対し脆弱な遷移を伴うメソッド呼び出し箇所だけでなく、外部入力データ箇所および該データが経由するメソッドの情報を提供できるため、プログラマの目視による脆弱性の判断および対策に要する作業量を軽減することができる。
また、脆弱な箇所だけでなく、現状では脆弱ではないものの該当箇所以外のコードを少し変更しただけで脆弱となってしまう潜在的に脆弱な箇所まで検出できる。
また、該脆弱な箇所と該潜在的に脆弱な箇所を区別して検出できるため、プログラマが危険度の高いものから順番に効果的に対策を行えるようになる。
According to the present invention, it is possible to provide not only a method call location with a fragile transition to a programmer but also information on an external input data location and a method through which the data passes. The amount of work required can be reduced.
Also, not only vulnerable parts, but also potentially vulnerable parts that are not vulnerable at present but that become vulnerable can be detected just by changing a code other than the relevant parts.
Further, since the vulnerable portion and the potentially vulnerable portion can be detected separately, the programmer can effectively take countermeasures in order from the one with the highest degree of danger.

以下、本発明の実施形態を図面により詳細に説明する。
なお、以下の実施形態にいては、java言語を使用したアプリケーションを例に挙げて説明する。また、以下の説明および図面では、パッケージ名を省略しjava.io.PrintWriterをPrintWriter、java.lang.StringをString、javax.servlet.http.HttpServletRequest、HttpServletRequest、javax.servlet.http.HttpServletRequestをHttpServletResponse、javax.servlet.jsp.JspWriterをJspWriterと表記する。
また、前提として、外部からデータを取得するメソッドにHttpServletRequest.getParameter(String)がある。
これは第1引数に指定した名前を持つパラメータの値を取得するメソッドであり、第1引き数値からパラメータ名を取得できる。一方、strutsフレームワークを用いたソースコードの場合、フォームビーンのsetterメソッドにより外部からのデータを取得するが、このメソッドの名前にパラメータ名が含まれる。そのため同様にパラメータ名を取得できる。このような方法で取得したパラメータの名前を外部データDB12Eに登録する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
In the following embodiments, an application using the java language will be described as an example. Also, in the following description and drawings, the package name is omitted, java.io.PrintWriter is PrintWriter, java.lang.String is String, javax.servlet.http.HttpServletRequest, HttpServletRequest, javax.servlet.http.HttpServletRequest is HttpServletResponse, javax.servlet.jsp.JspWriter is written as JspWriter.
As a premise, HttpServletRequest.getParameter (String) is a method for acquiring data from the outside.
This is a method for acquiring the value of the parameter having the name specified as the first argument, and the parameter name can be acquired from the first argument value. On the other hand, in the case of source code using the struts framework, external form data is acquired by the form bean setter method, and the parameter name is included in the name of this method. Therefore, the parameter name can be acquired similarly. The parameter name acquired by such a method is registered in the external data DB 12E.

図1は、本発明の一実施の形態を表すシステム構成図である。
図1において、サーバ1とクライアント2は、ネットワーク3によって繋がっている。サーバ1は、CPU11A、メモリ11Bからなる端末装置11と、ソースコードを解析して脆弱性の検査を行うソースコード検査手段12Aと、予めライブラリメソッドを登録しておくライブラリメソッドDB12Bと、プログラマが定義したメソッドを管理するためのプログラマ定義メソッドDB12C、変数の値を管理する変数DB12Dと、外部データを取得した位置を管理する外部データDB12Eと、検査によって得られた脆弱性を生じる可能性のあるコードに関する情報を記録するための中間結果レポート12Fと、クラス名とURLを対応付けたクラスURLマッピングDB12Gと、Webアプリケーションの稼動環境であるWebアプリケーション供給手段12Hが格納されている外部記憶装置12と、通信ポート13から構成されている。
FIG. 1 is a system configuration diagram showing an embodiment of the present invention.
In FIG. 1, a server 1 and a client 2 are connected by a network 3. The server 1 includes a terminal device 11 including a CPU 11A and a memory 11B, source code checking means 12A for checking a vulnerability by analyzing source code, a library method DB 12B for registering a library method in advance, and a programmer definition A programmer-defined method DB12C for managing the selected method, a variable DB12D for managing the value of the variable, an external data DB12E for managing the position where the external data was acquired, and a code that may cause the vulnerability obtained by the inspection An intermediate result report 12F for recording information on the class, a class URL mapping DB 12G in which class names and URLs are associated with each other, an external storage device 12 in which Web application supply means 12H, which is an operating environment of the Web application, is stored, Consists of communication port 13 .

クライアント2は、CPU21A、メモリ21Bからなる端末装置21と、Webアプリケーション検査管理手段22Aと、Webアプリケーション実行検査手段22Bと、クライアントからWebアプリケーションに対し入力される、Webアプリケーション開発者が想定する正常なパラメータ値を登録したリクエストパラメータDB22Cと、Webアプリケーション実行検査手段22Bが利用するための判断基準であるレスポンス脆弱性判定DB22Dと、検査データDB22Eと、脆弱性検査の結果を記述する結果レポート22Fが格納されている外部記憶装置22と、通信ポート23から構成されている。   The client 2 includes a terminal device 21 including a CPU 21A and a memory 21B, a Web application inspection management unit 22A, a Web application execution inspection unit 22B, and a normal application assumed by the Web application developer that is input from the client to the Web application. Stored are a request parameter DB 22C in which parameter values are registered, a response vulnerability determination DB 22D that is a criterion for use by the Web application execution inspection unit 22B, an inspection data DB 22E, and a result report 22F describing the results of the vulnerability inspection. The external storage device 22 and the communication port 23 are configured.

図2は、検査対象Webアプリケーションのソースコードである。説明のため最も左端に行番号を記載している。import文は省略している。このソースコードでは、3、4、10行目にてプログラム外部からのデータを取得している。
PrintWriter.println(String)メソッドもしくはそれを内部で呼ぶメソッドの呼び出しが6、7、8、9、12行目で行われており、このうち6、7、8、9行目が脆弱である。それに対し12行目は、第一引き数に渡されるデータの内容が、その手前の11行目の条件文でチェックされているため、脆弱性ではない。ただし、この12行目は、該当箇所以外の箇所、今の場合11行目の条件文のコードを少し変更しただけで、脆弱性が発生してしまう潜在的に脆弱な箇所である。
FIG. 2 shows the source code of the inspection target Web application. For the sake of explanation, the line number is shown on the far left. The import statement is omitted. In this source code, data from outside the program is acquired on the 3rd, 4th, and 10th lines.
Calls to the PrintWriter.println (String) method or methods that call it internally are made on lines 6, 7, 8, 9, and 12. Of these, lines 6, 7, 8, and 9 are vulnerable. On the other hand, line 12 is not vulnerable because the contents of the data passed to the first argument are checked by the conditional statement in line 11 before that. However, this 12th line is a potentially vulnerable part where a vulnerability is generated just by changing the code of the conditional statement on the 11th line in a part other than the applicable part.

図3は、検査対象のWebアプリケーションに対応する入力ページの例である。
図4は、マッピングDB12Gの例である。該DBはWebアプリケーション名、ソースコード名、クラス名、URL名からなる。URLにはWebアプリケーションのルートからの相対パスを指定する。URLが無い場合は空白とする。
FIG. 3 is an example of an input page corresponding to the Web application to be inspected.
FIG. 4 is an example of the mapping DB 12G. The DB includes a Web application name, a source code name, a class name, and a URL name. Specify the relative path from the root of the Web application in the URL. If there is no URL, leave it blank.

図5はクライアント端末のWebアプリケーション検査管理手段22Aと、サーバのWebアプリケーション実行検査手段22B、ソースコード検査手段12A、およびWebアプリケーション供給手段12Fの間でやりとりされる命令及びデータの流れを示した図である。なお、検査対象のWebアプリケーションは、Webアプリケーション供給手段12Cによりサービスを提供可能な状態にあるとする。
まず始めに、Webアプリケーション検査管理手段22Aは検査対象アプリケーション名をソースコード検査手段12Aに伝達する(ステップ501)。
ソースコード検査手段12Aは、マッピングDB12Gに登録された該検査対象アプリケーションに相当するソースコード12Iを取得し、そのソースコード検査を実施し(ステップ502)、その結果を中間結果レポートとしてWebアプリケーション検査管理手段22Aに送付する。
この時、クラス名とURLを対応付けたクラスURLマッピングDB12Gも同時に送付する(ステップ503)。
FIG. 5 is a diagram showing a flow of instructions and data exchanged between the Web application inspection management unit 22A of the client terminal, the Web application execution inspection unit 22B of the server, the source code inspection unit 12A, and the Web application supply unit 12F. It is. It is assumed that the Web application to be inspected is in a state where the service can be provided by the Web application supply unit 12C.
First, the Web application inspection management unit 22A transmits the inspection target application name to the source code inspection unit 12A (step 501).
The source code inspection unit 12A acquires the source code 12I corresponding to the inspection target application registered in the mapping DB 12G, performs the source code inspection (step 502), and uses the result as an intermediate result report for Web application inspection management. It is sent to the means 22A.
At this time, the class URL mapping DB 12G in which the class name is associated with the URL is also sent (step 503).

次に、Webアプリケーション検査管理手段22Aは、Webアプリケーション実行検査手段12Bに対し、中間結果レポート12FおよびクラスURLマッピングDBをWebアプリケーション実行検査手段12Bに送付する(ステップ504)。
Webアプリケーション実行検査手段12Bはこれらから検査ページURLと検査パラメータ名の情報を取得するとともに、リクエストパラメータDBおよび検査データDBを参照することで、検査用リクエストデータを組み立て、それをWebアプリケーション供給手段12Fにより供給されている検査対象Webアプリケーションに送付する(ステップ505)。
その後、Webアプリケーション実行検査手段12BはWebアプリケーションからの応答を受信し(ステップ506、507)、脆弱性判定DB22Dの脆弱性判定データと比較することで脆弱性かどうかを判定する(ステップ508)。そして、ステップ505から508までは各パラメータおよび検査データ値について繰り返す。
そして、その結果を、Webアプリケーション検査管理手段22Aに通知し(ステップ509)、最終的に結果レポートを生成する。このとき、ソースコード検査及びWebアプリケーション実行検査の両方で脆弱性と判定されたものは深刻度高、ソースコード検査でのみ脆弱性と判定されたものは深刻度低として出力する(ステップ510)。
最後に検査終了をWebアプリケーション実行検査手段12Bおよびソースコード検査手段12Aに告げる(ステップ511)。
Next, the Web application inspection management unit 22A sends the intermediate result report 12F and the class URL mapping DB to the Web application execution inspection unit 12B to the Web application execution inspection unit 12B (Step 504).
The Web application execution inspection unit 12B obtains the information of the inspection page URL and the inspection parameter name from these, assembles the request data for inspection by referring to the request parameter DB and the inspection data DB, and combines the request data with the Web application supply unit 12F. (Step 505).
Thereafter, the web application execution inspection unit 12B receives a response from the web application (steps 506 and 507), and determines whether the vulnerability is present by comparing with the vulnerability determination data in the vulnerability determination DB 22D (step 508). Steps 505 to 508 are repeated for each parameter and inspection data value.
Then, the result is notified to the Web application inspection management means 22A (step 509), and finally a result report is generated. At this time, those that are determined to be vulnerable in both the source code inspection and the Web application execution inspection are output as high severity, and those that are determined to be vulnerable only in the source code inspection are output as low severity (step 510).
Finally, the end of inspection is notified to the Web application execution inspection unit 12B and the source code inspection unit 12A (step 511).

図6は、ライブラリメソッドDB12Bの格納データの例である。
ライブラリメソッドDB12Bは、標準ライブラリに含まれるメソッド等のデータ遷移を予め登録したデータベースである。1列目はメソッド名、2列目はどの値がどこに遷移するかを示すデータ遷移のリストである。ここではデータ遷移を’→’を用いて表記し、’→’の左を遷移元、’→’の右を遷移先とする。遷移元および遷移先の値に設定する値には、引数番号、外部データを表すIN、戻り値を表すR、脆弱性を生じる可能性のある遷移先であるVUL_XSS、obj.method() 形式のメソッド呼び出しのobjを指すメソッド呼び出し元オブジェクトフラグTHISがある。遷移先にはこれらのうちのいずれかを、遷移元にはこれらのいずれかもしくはその組み合わせを設定する。
FIG. 6 is an example of data stored in the library method DB 12B.
The library method DB 12B is a database in which data transitions such as methods included in the standard library are registered in advance. The first column is a method name, and the second column is a data transition list indicating which value transitions to where. Here, data transition is expressed using “→”, the left of “→” is the transition source, and the right of “→” is the transition destination. The values set in the transition source and transition destination values include the argument number, IN representing external data, R representing the return value, VUL_XSS which is the transition destination that may cause vulnerability, and obj.method () format There is a method caller object flag THIS that points to obj of the method call. One of these is set as the transition destination, and any one or combination thereof is set as the transition source.

図7は、プログラマ定義メソッドDB12Cの格納データの例である。
プログラマ定義メソッドDB12Cには、プログラマが定義したメソッドについてのデータ遷移情報を、ソースコード解析中に登録する。本DBのうち1列目および2列目は、ライブラリメソッドDB12Bと同様である。ただし、遷移値の遷移元に外部データを設定する場合は、INの代わりにINi(i=1,・・n)(nは十分大きな正の整数)が設定される。
3列目の解析済みフラグはそのメソッド定義の解析を終了したかどうかを表すフラグである。解析済みフラグは0か1の値をとり、解析済みフラグが0であるメソッドは、後述の手順906から911までの解析が終了していないことを表し、一方、1であるメソッドは前記解析が終了していることを表す。初期値は0とする。以下、前記解析が終了していないメソッドの状態を未解析であると呼ぶ。
4列目の脆弱メソッド名は初期値をnullとし、遷移値の遷移先に脆弱メソッドフラグVUL_XSSが設定されている場合にのみ脆弱なメソッドの名前を登録する。
FIG. 7 is an example of data stored in the programmer-defined method DB 12C.
In the programmer-defined method DB 12C, data transition information on a method defined by the programmer is registered during source code analysis. The first and second columns of this DB are the same as the library method DB 12B. However, when external data is set as the transition source of the transition value, INi (i = 1,... N) (n is a sufficiently large positive integer) is set instead of IN.
The analyzed flag in the third column is a flag indicating whether or not the analysis of the method definition is completed. The analyzed flag takes a value of 0 or 1, and a method whose analyzed flag is 0 indicates that the analysis from steps 906 to 911 to be described later has not been completed. Indicates that it has finished. The initial value is 0. Hereinafter, the state of the method that has not been analyzed is referred to as unanalyzed.
The weak method name in the fourth column is initially set to null, and the name of the vulnerable method is registered only when the weak method flag VUL_XSS is set in the transition destination of the transition value.

図8は、変数DB12Dの格納データの例である。
1列目は変数DB12Dに登録された変数の識別番号である。この変数番号は、static変数の場合、負の整数値で−1、−2と降順に付ける。仮引数の場合、引数番号と一致する正の整数値を付ける。ローカル変数の場合、既に登録されている仮引数の変数番号に続くように昇順に付ける。正の整数値が1つも登録されていない場合、1から順に昇順に付ける。
2列目は変数の種別を表し、仮引数を登録する場合は’A’、ローカル変数なら’L’、static変数なら'S'を格納する。
3列目は変数名である。
4列目は変数の保持する値であり、初期値は変数番号と同一の値とする。値が定数の場合は、Cとする。後述する検査対象ソースコードに配列変数の遷移がないため、簡略化して記述したが、変数DB12Dに変数の次元を加えることで引数変数に書き込むデータ遷移などにも対応できる。
FIG. 8 is an example of data stored in the variable DB 12D.
The first column is an identification number of a variable registered in the variable DB 12D. In the case of a static variable, this variable number is a negative integer value and is assigned in the descending order of −1 and −2. For dummy arguments, a positive integer value that matches the argument number is attached. In the case of local variables, they are assigned in ascending order so as to follow the variable numbers of the formal parameters already registered. If no positive integer value is registered, the numbers are assigned in ascending order from 1.
The second column indicates the type of the variable. When registering a dummy argument, 'A' is stored, 'L' is stored for a local variable, and 'S' is stored for a static variable.
The third column is the variable name.
The fourth column is a value held by the variable, and the initial value is the same value as the variable number. If the value is a constant, use C. Since there is no transition of the array variable in the inspection target source code to be described later, the description is simplified, but it is also possible to cope with data transition to be written to the argument variable by adding the variable dimension to the variable DB 12D.

図9は、本実施形態のソースコード脆弱性検査装置の処理手順を示すフローチャートである。
ソースコード検査手段12Aが起動されると、検査対象のWebアプリケーションのソースコードを読み込み、そのソースコードを全てたどり、見つかったプログラマ定義メソッドをプログラマ定義メソッドDB12Cに、static変数を変数DB12Dに、それぞれ登録する。static変数の変数番号は、負の整数値で−1から降順に付ける(ステップ901)。
次に、ソースコードの先頭を探索開始位置にする(ステップ902)。ソースファイルが複数ある場合、任意のファイルの先頭を探索開始位置とする。
次に、ソースコード中から、未解析であるメソッド定義を探索する(ステップ903)。未解析のメソッドが無い場合は後述するステップ912に移る(ステップ903)。該当メソッドが見つかれば、次に、該当メソッドの定義の中で、未解析のメソッド呼び出しが行われていないかを探索する(ステップ904)。未解析のメソッド呼び出しが行われている場合、探索開始位置をソースコード中の次のメソッド定義位置に移し(ステップ905)、ステップ903に戻る。未解析のメソッド呼び出しが行われていない場合、該メソッドを処理対象メソッドとし、解析を開始する(ステップ906)。対象メソッドの仮引数があればそれを変数DB12Dに登録する(ステップ907)。このとき、仮引数の変数番号は、その引数番号と一致するように登録する。そして、メソッド定義内解析処理(ステップ908)に移る。これは図10に示す。
FIG. 9 is a flowchart showing a processing procedure of the source code vulnerability check apparatus according to the present embodiment.
When the source code checking means 12A is activated, the source code of the Web application to be checked is read, the source code is traced, the found programmer-defined method is registered in the programmer-defined method DB 12C, and the static variable is registered in the variable DB 12D. To do. The variable numbers of static variables are negative integer values and are assigned in descending order from −1 (step 901).
Next, the beginning of the source code is set as the search start position (step 902). If there are multiple source files, the beginning of any file is set as the search start position.
Next, an unanalyzed method definition is searched from the source code (step 903). If there is no unanalyzed method, the process proceeds to step 912 described later (step 903). If the corresponding method is found, next, it is searched whether an unanalyzed method call has been made in the definition of the corresponding method (step 904). If an unanalyzed method call has been made, the search start position is moved to the next method definition position in the source code (step 905), and the process returns to step 903. If an unanalyzed method call has not been made, the method is set as a processing target method, and analysis is started (step 906). If there is a formal argument of the target method, it is registered in the variable DB 12D (step 907). At this time, the variable number of the dummy argument is registered so as to match the argument number. Then, the method definition analysis process (step 908) is performed. This is shown in FIG.

対象メソッドの終了箇所に至るまで、ステップ908を繰り返す。対象メソッドの処理を終えたら、解析済みフラグを1に設定し、ステップ910に移る(ステップ909)。
次に、変数DB12Dから仮引数とローカル変数についての登録データを削除する。static変数の値のうちINi以外の値を初期化する(ステップ911)。対象メソッドについての処理を終え、ステップ903に戻る。
ステップ912では変数DB12Dに、前回解析時と比較して、static変数の値の変化があるかどうかを調べる。変更がある場合、プログラマ定義メソッドDB12Cの解析済みフラグの値をすべて0に初期化し、ステップ903へ戻る。一方、無い場合は処理を終了する。
Step 908 is repeated until the end of the target method is reached. When the processing of the target method is completed, the analyzed flag is set to 1 and the process proceeds to step 910 (step 909).
Next, the registration data regarding the dummy argument and the local variable is deleted from the variable DB 12D. Of the values of static variables, values other than INi are initialized (step 911). The process for the target method is finished, and the process returns to Step 903.
In step 912, it is checked whether or not there is a change in the value of the static variable in the variable DB 12D as compared with the previous analysis. If there is a change, the values of the analyzed flag in the programmer-defined method DB 12C are all initialized to 0, and the process returns to step 903. On the other hand, if not, the process is terminated.

次に、図10に示すメソッド内解析処理のフローチャートについて説明する。
ここでは、解析箇所がローカル変数定義箇所でなければ、ステップ9203に移る(ステップ9201)。ローカル変数定義箇所であれば、定義されている変数を変数DB12Dに登録する。変数番号は、正の整数で昇順に付ける(ステップ9202)。
解析箇所が変数アクセス箇所でなければ、ステップ9205に移る(ステップ9203)。変数アクセス箇所であれば、変数DB12Dから該変数の値を取得する(ステップ9204)。
解析箇所がメソッド呼び出し箇所でなければ、終了する(ステップ9205)。メソッド呼び出し箇所であれば、メソッド名でライブラリメソッドDB12Bおよびプログラマ定義メソッドDB12Bを探索し、該当メソッドの遷移値を取得する(ステップ9206)。
Next, a flowchart of the in-method analysis process shown in FIG. 10 will be described.
Here, if the analysis location is not a local variable definition location, the process moves to step 9203 (step 9201). If it is a local variable definition location, the defined variable is registered in the variable DB 12D. Variable numbers are given in ascending order as positive integers (step 9202).
If the analysis location is not a variable access location, the process moves to step 9205 (step 9203). If it is a variable access location, the value of the variable is acquired from the variable DB 12D (step 9204).
If the analysis location is not a method call location, the process ends (step 9205). If it is a method call location, the library method DB 12B and the programmer-defined method DB 12B are searched with the method name, and the transition value of the corresponding method is acquired (step 9206).

遷移値がない場合、処理を終える(ステップ9207)。遷移値がある場合、最初の遷移値を取り出す。遷移の遷移元が正の整数(引数番号)である場合、その遷移元を引数番号に相当する実引数値に修正後、以下の処理を行う。
遷移元がTHISである場合、メソッド呼び出し元の変数の値に修正後、以下の処理を行う。それ以外の場合、何もせず以下の処理を行う(ステップ9208)。
遷移先がVUL_XSSで、遷移元にINiを含むデータ遷移であれば、ソース中の該当箇所への警告を検査結果として出力するため、ステップ9210の中間出力レポート処理に移る(ステップ9209)。ステップ9210については図11で説明する。この手順を追えるとステップ9206に移る(ステップ9210)。
遷移元にINを含む遷移を持つライブラリメソッドである外部データ取得メソッドの呼び出し箇所であれば、ステップ9212で外部データDBに登録した後、ステップ9213に移る。そうでなければステップ9213に移る。外部データDB12Eに登録する外部データフラグ名は1箇所目はIN1、2箇所目はIN2、・・とする(ステップ9211、9212)。
If there is no transition value, the process ends (step 9207). If there is a transition value, the first transition value is extracted. When the transition source of the transition is a positive integer (argument number), the following processing is performed after correcting the transition source to an actual argument value corresponding to the argument number.
When the transition source is THIS, the following processing is performed after correcting the value of the method call source variable. Otherwise, the following processing is performed without doing anything (step 9208).
If the transition destination is VUL_XSS and the data transition includes INi in the transition source, the process proceeds to the intermediate output report process in step 9210 in order to output a warning to the corresponding part in the source as the inspection result (step 9209). Step 9210 will be described with reference to FIG. If this procedure is followed, the process moves to step 9206 (step 9210).
If it is an invocation location of an external data acquisition method that is a library method having a transition including IN as a transition source, it is registered in the external data DB in step 9212 and then the process proceeds to step 9213. Otherwise, go to Step 9213. The external data flag name registered in the external data DB 12E is IN1 at the first location, IN2 at the second location, and so on (steps 9211 and 9212).

ステップ9213において、データ遷移の遷移先の値に応じて処理を行う。遷移先が変数番号であれば、変数DB12Dの該当する変数値を更新する。遷移先が戻り値を表すRであれば、以後の処理で遷移元の値を持つ変数が該メソッドの位置に記述されていた場合と同じように扱う。
遷移先が変数番号でない遷移の場合、プログラマ定義メソッドDB12Cに追加する。
なお、代入文についても、右辺が左辺に遷移するデータ遷移として、メソッド呼び出しと同様に処理する。
In step 9213, processing is performed according to the transition destination value of the data transition. If the transition destination is a variable number, the corresponding variable value in the variable DB 12D is updated. If the transition destination is R representing the return value, it is handled in the same way as when the variable having the transition source value is described at the position of the method in the subsequent processing.
If the transition destination is not a variable number, it is added to the programmer-defined method DB 12C.
The assignment statement is also processed in the same manner as the method call as a data transition in which the right side transitions to the left side.

次に、図11のフローチャートについて説明する。このフローチャートは中間出力レポートへの1つのレコードを出力する際の手順を示したものである。なお重複するレコードは出力しない。
まず、脆弱箇所に脆弱メソッド名および、クラス名と行番号からなる位置の組を設定する(ステップ9301)。遷移元の名前INiを元に外部データDBを検索し、該当レコードの入力データ情報を取得し、それを入力箇所に設定する(ステップ9302)。経由メソッドの初期値をnullとする(ステップ9303)。
脆弱メソッド名がライブラリメソッドDB12B内になければ、ステップ9305に移る。あれば、ステップ9306に移る(ステップ9304)。ステップ9305では、該メソッドをプログラム定義メソッドDB12Cから検索し、該当レコードのメソッド名を経由メソッドに追加登録する。ステップ9306では、脆弱箇所、入力箇所、経由メソッドを出力する。そして処理を終える。
Next, the flowchart of FIG. 11 will be described. This flowchart shows a procedure for outputting one record to the intermediate output report. Duplicate records are not output.
First, a vulnerable method name and a set of positions consisting of a class name and a line number are set in the vulnerable part (step 9301). The external data DB is searched based on the transition source name INi, the input data information of the corresponding record is acquired, and it is set as the input location (step 9302). The initial value of the route method is set to null (step 9303).
If the vulnerable method name is not in the library method DB 12B, the process moves to step 9305. If there is, the process proceeds to Step 9306 (Step 9304). In step 9305, the method is retrieved from the program definition method DB 12C, and the method name of the corresponding record is additionally registered in the via method. In step 9306, the vulnerable part, the input part, and the transit method are output. Then, the process ends.

次に、図2のソースコードに対して、図9〜図11の処理を適用した場合の処理を説明する。
まず、内部で他のプログラマ定義メソッド呼び出しのないmethod2およびmethodRetが最初に解析される。
次に、内部で用いられているプログラマ定義メソッドがmethod2だけであるmethod1及びmethoDB1が解析され最後にdoGetが解析される。ここでは特に、doGetメソッド定義の処理について説明する。
method1、method2、methoDB1、methodRetについてステップ901終了時のプログラマ定義メソッドDB12Cを図12に示す。
図12において、method1、method2、methoDB1の遷移値は1→VUL_XSSである。method2では内部でPrintWriter.println(String)が、method1では内部でmethod2が、methoDB1ではその両方が、第一引数の値が各第1引き数に渡される形で呼ばれている。よって脆弱メソッド名は図示のようになる。
Next, processing when the processing of FIGS. 9 to 11 is applied to the source code of FIG. 2 will be described.
First, method2 and methodRet without any other programmer-defined method calls are parsed first.
Next, method1 and methoDB1 whose only programmer-defined method is method2 are analyzed, and finally doGet is analyzed. In particular, the doGet method definition process is described here.
FIG. 12 shows a programmer-defined method DB 12C at the end of step 901 for method1, method2, methoDB1, and methodRet.
In FIG. 12, the transition values of method1, method2, and methoDB1 are 1 → VUL_XSS. In method2, PrintWriter.println (String) is called internally, in method1, method2 is called internally, and in methoDB1, both are called in such a way that the value of the first argument is passed to each first argument. Therefore, the vulnerable method name is as shown.

method1、method2、methoDB1、methodRetの解析後、doGetメソッドが未解析で、定義内で未解析のメソッド呼び出しが行われていないことが分かる(ステップ903および3404)。よって、doGetを解析対象のメソッド(対象メソッド)とする(ステップ906)。
まず対象メソッドdoGetに対し、仮引数とローカル変数を変数DB12Dに登録する(ステップ907)。3行目および4行目では外部データ取得メソッドHttpServletRequest.getParameter(String)メソッドがあるため、外部データDB12Eの格納データは図13のようになる。
After analysis of method1, method2, methoDB1, and methodRet, it can be seen that the doGet method has not been analyzed, and no unanalyzed method call has been made in the definition (steps 903 and 3404). Therefore, doGet is set as a method to be analyzed (target method) (step 906).
First, a dummy argument and a local variable are registered in the variable DB 12D for the target method doGet (step 907). Since there are external data acquisition methods HttpServletRequest.getParameter (String) method in the third and fourth lines, the data stored in the external data DB 12E is as shown in FIG.

doGetについて5行目までの解析終了時の変数DB12Dの格納データが、図14である。
次に、6行目のメソッドmethod1の呼び出しによるデータ遷移の処理を行う(ステップ908)。method1の遷移値を、ライブラリメソッドDB12Bおよびプログラマ定義メソッドDB12Cより検索し取り出す。すると、1→VUL_XSSの遷移が取得される。遷移元の1は第一引き数を表し、第1引き数に与えられた変数sの参照する値を変数DB12Dから得て遷移元を書き換えるとIN1→VUL_XSSと、脆弱な遷移となるため、この行を脆弱な箇所として中間レポートに出力する。このとき入力箇所については外部データDBのフラグ名がIN1のレコードから取得し、経由メソッドについてはプログラマ定義メソッドDBの脆弱メソッド名から取得する。
FIG. 14 shows data stored in the variable DB 12D at the end of analysis up to the fifth line for doGet.
Next, data transition processing is performed by calling method method1 on the sixth line (step 908). The transition value of method1 is retrieved from the library method DB 12B and the programmer-defined method DB 12C. Then, 1 → VUL_XSS transition is acquired. 1 of the transition source represents the first argument, and when the value referred to by the variable s given to the first argument is obtained from the variable DB 12D and the transition source is rewritten, IN1 → VUL_XSS, which is a weak transition, Output lines to the intermediate report as vulnerable points. At this time, the input location is acquired from the record whose flag name of the external data DB is IN1, and the via method is acquired from the vulnerable method name of the programmer-defined method DB.

次に7行目のメソッドmethod2の呼び出しによるデータ遷移の処理を行う(ステップ908)。6行目の処理とほぼ同じであるが、第1引き数に与えられた変数の値がIN1およびIN2である。そのため入力箇所は2箇所を並列に並べて出力する。
次に8行目のメソッドmethoDB1の呼び出しによるデータ遷移の処理を行う(ステップ908)。6行目の処理とほぼ同じであるが、脆弱メソッド名が2つあるため、経由メソッドも2つ並べて出力される。
Next, data transition processing is performed by calling method method2 on the seventh line (step 908). The process is almost the same as the process on the sixth line, but the values of the variables given to the first argument are IN1 and IN2. Therefore, two input locations are output in parallel.
Next, data transition processing is performed by calling the method methoDB1 on the eighth line (step 908). Although it is almost the same as the process on the sixth line, since there are two vulnerable method names, two via methods are also output side by side.

次に9、12行目のメソッドPrintWriter.println(String)の呼び出しによるデータ遷移の処理を行う(ステップ908)。6行目の処理とほぼ同じであるが、直接脆弱なライブラリメソッドを呼び出しているため、経由メソッドはない。
以上で対象メソッドdoGetの処理を終える(ステップ909)。ステップ909終了時のプログラマ定義メソッドDB12Cは図12のdoGetの解析済みフラグを1に変更したものである。
未解析のメソッド探索(ステップ903)にて該当メソッドが見つからないのでステップ912に移る。
この検査対象ソースコードにはstatic変数は定義されていない。よって検査を終了する。
Next, data transition processing is performed by calling the method PrintWriter.println (String) on the 9th and 12th lines (step 908). The process is almost the same as the process on the sixth line, but there is no transit method because a weak library method is directly called.
This completes the processing of the target method doGet (step 909). The programmer-defined method DB 12C at the end of step 909 is obtained by changing the doGet analyzed flag in FIG.
Since the corresponding method is not found in the unanalyzed method search (step 903), the process proceeds to step 912.
There are no static variables defined in the source code to be checked. Therefore, the inspection is finished.

図15は中間出力レポート1300の例である。
1列目の1301は脆弱な遷移を伴うメソッド呼び出しが行われている脆弱箇所、2列目の1302はその原因となる外部データの入力箇所、3列目の1303は原因となる外部データが脆弱なライブラリメソッドに渡されるまでに経由するメソッドを経由する順番に表す経由メソッドである。その内容は前述した通りである。
FIG. 15 is an example of the intermediate output report 1300.
1301 in the first column is a vulnerable location where a method call with a vulnerable transition is being performed, 1302 in the second column is the input location of the external data that causes it, 1303 in the third column is the vulnerable external data that is the cause It is a passing method that represents the order of passing through the passing method until it is passed to the library method. The contents are as described above.

図16は検査データDB22Eの格納データ1401の例である。
図17(a)はクライアントからWebアプリケーションに対し入力される、Webアプリケーション開発者が想定する正常なリクエストパラメータ値を登録したリクエストパラメータDB22Cの格納データの例であり、検査対象ページのURL1501、パラメータ名1502、パラメータ値1503の組からなる。
FIG. 16 shows an example of stored data 1401 in the inspection data DB 22E.
FIG. 17 (a) is an example of data stored in the request parameter DB 22C in which normal request parameter values assumed by the Web application developer are input from the client to the Web application. The URL 1501 of the inspection target page, the parameter name 1502 and a parameter value 1503.

図17(b)は図17(a)に対応するリクエストデータの例である。ステップ505では、このリクエストデータのうち、検査すべきパラメータのデータ値だけを検査データ値に変更したリクエストデータを組み立てて、Webアプリケーション実行検査手段22BからWebアプリケーション検査管理手段22Aに対して送信する。   FIG. 17B is an example of request data corresponding to FIG. In step 505, request data in which only the data value of the parameter to be inspected is changed to the inspection data value among the request data is assembled and transmitted from the Web application execution inspection unit 22B to the Web application inspection management unit 22A.

図18はレスポンス脆弱性判定DB22Dの格納データの例であり、レスポンス脆弱性判定コード1601からなる。このDB22Dに登録されたコードがレスポンスデータに含まれた場合に脆弱性であると判断する。   FIG. 18 shows an example of data stored in the response vulnerability determination DB 22D, which includes a response vulnerability determination code 1601. When the code registered in the DB 22D is included in the response data, it is determined to be a vulnerability.

図19は結果レポートの例を示す図である。
1列目は脆弱性の深刻度合いを表す深刻度、2列目は脆弱な遷移を伴うメソッド呼び出しが行われている脆弱箇所、3列目はその原因となる外部データの入力箇所、4列目は原因となる外部データが脆弱なライブラリメソッドに渡されるまでに経由するメソッドを経由する順番に表す経由メソッドである。
Webアプリケーション実行検査の結果、図15の中間結果レポートのうち、上から4箇所については脆弱で、5箇所目についてはそうではないという結果が得られ、その内容をステップ509にてWebアプリケーション検査管理手段22Aに通知し、Webアプリケーション検査管理手段22Aが最終的な検査結果の通知として、ステップ510で生成したのが図19の結果レポートである。
ソースコード検査及びWebアプリケーション実行検査の両方で脆弱性と判定されたものは深刻度高、ソースコード検査でのみ脆弱性と判定されたものは深刻度低として出力する。後者は脆弱性ではないものの該当箇所以外のコードを少し変更しただけで脆弱性となってしまう箇所(潜在的な脆弱性)である。このような箇所は脆弱性対策の優先度は低いが、深刻度の高い箇所の対策が済んだ時点でソフトウェア開発の工数に余裕があればできれば対策を行っておいた方が良い所である。
経由メソッドは特にメソッドの数がある程度多く、メソッド呼び出しが深いときに役立つ。
経由メソッドが出力されない従来の方法では、例えばAクラスの6行目で指摘を出しても、その具体的な理由である、外部データ取得メソッド、経由メソッド、脆弱メソッドの情報が無ければ対処に時間が掛かってしまう。それに対し、本発明の方法では、脆弱なメソッドの使い方次第であるが、例の場合method1は経由メソッドに記述されるいずれかの場所でサニタイジングすればよいと分かり脆弱性対策にかかる工数が少なくて済む。
FIG. 19 is a diagram showing an example of a result report.
The first column is the severity that indicates the severity of the vulnerability, the second column is the vulnerable location where the method call with the vulnerable transition is performed, the third column is the input location of the external data that causes it, the fourth column Is a passing method that represents the order in which the causal external data is passed to the vulnerable library method.
As a result of the Web application execution inspection, in the intermediate result report of FIG. 15, it is obtained that the four points from the top are vulnerable and the fifth point is not. The result report shown in FIG. 19 is generated in step 510 as a notification of the final inspection result by the Web application inspection management unit 22A.
Those that are determined to be vulnerable in both source code inspection and Web application execution inspection are output as high severity, and those that are determined to be vulnerable only in source code inspection are output as low severity. Although the latter is not a vulnerability, it is a part (potential vulnerability) that becomes a vulnerability just by slightly changing the code other than the corresponding part. Although the priority of vulnerability countermeasures is low in such places, it is better to take countermeasures if the software development man-hours are sufficient when countermeasures for highly serious places are completed.
Via methods are particularly useful when the number of methods is large to some extent and method calls are deep.
In the conventional method in which the transit method is not output, for example, even if an indication is made on the 6th line of the A class, if there is no information on the external data acquisition method, transit method, and vulnerable method, which is the specific reason, it will take time to deal with it. Will be applied. On the other hand, in the method of the present invention, it depends on how the vulnerable method is used, but in the case of the method, it can be understood that method1 should be sanitized at any location described in the via method, and the man-hours required for vulnerability countermeasures are small. That's it.

なお、上記の実施形態については、本発明をWebアプリケーションの検査を行う適用例について説明したが、本発明はこれに限定されるものではなく、各種のアプリケーションに適用可能であることは言うまでもない。   In the above embodiment, the application example in which the present invention inspects the Web application has been described. However, the present invention is not limited to this and can be applied to various applications.

本発明の一実施の形態例を示すシステム構成図である。1 is a system configuration diagram showing an embodiment of the present invention. 検査対象Webアプリケーションのソースコードの例を示す図である。It is a figure which shows the example of the source code of a web application to be examined. 検査対象Webアプリケーションの入力ページの例を示す図である。It is a figure which shows the example of the input page of a web application to be examined. クラス名URLマッピングDBの格納データの例を示す図である。It is a figure which shows the example of the storage data of class name URL mapping DB. 本発明の脆弱性検査の動作を示すシーケンス図である。It is a sequence diagram which shows operation | movement of the vulnerability test | inspection of this invention. ライブラリメソッドDBの格納データの構成図である。It is a block diagram of the storage data of library method DB. プログラマ定義メソッドDBの格納データの構成図である。It is a block diagram of the storage data of programmer definition method DB. 変数DBの格納データの構成図である。It is a block diagram of the storage data of variable DB. ソースコード検査手段の処理手順を表すフローチャートである。It is a flowchart showing the process sequence of a source code inspection means. メソッド定義内解析処理の処理手順を表すフローチャートである。It is a flowchart showing the process sequence of the analysis process in a method definition. 中間結果出力処理の処理手順を表すフローチャートである。It is a flowchart showing the process sequence of an intermediate result output process. プログラマ定義メソッドDBの格納データの例を示す図である。It is a figure which shows the example of the storage data of programmer definition method DB. 外部データDBの格納データの例を示す図である。It is a figure which shows the example of the storage data of external data DB. 変数DBの格納データの例を示す図である。It is a figure which shows the example of the storage data of variable DB. 中間結果レポートの例を示す図である。It is a figure which shows the example of an intermediate result report. 検査データDBの格納データの例を示す図である。It is a figure which shows the example of the storage data of test | inspection data DB. リクエストパラメータDBの格納データとリクエストデータの例を示す図である。It is a figure which shows the example of the storage data and request data of request parameter DB. レスポンス脆弱性判定DBの格納データの例を示す図である。It is a figure which shows the example of the storage data of response vulnerability determination DB. 結果レポートの例を示す図である。It is a figure which shows the example of a result report.

符号の説明Explanation of symbols

11A、21A…CPU、11B、21B…メモリ、13、23…通信ポート、11、21…端末装置、12、22…外部記憶装置、3…ネットワーク、12A…ソースコード検査手段、12B…ライブラリメソッドDB、12C…プログラマ定義メソッドDB、12D…変数DB、12E…外部データDB、12F…中間結果レポート、12G…クラスURLマッピングDB、12H…Webアプリケーション供給手段、12I…ソースコード、22A…Webアプリケーション検査管理手段、22B…Webアプリ実行検査手段、22C…リクエストパラメータDB、22D…レスポンス脆弱性判定DB、22E…検査データDB、22F…結果レポート。   11A, 21A ... CPU, 11B, 21B ... Memory, 13, 23 ... Communication port, 11, 21 ... Terminal device, 12, 22 ... External storage device, 3 ... Network, 12A ... Source code checking means, 12B ... Library method DB , 12C ... Programmer definition method DB, 12D ... Variable DB, 12E ... External data DB, 12F ... Intermediate result report, 12G ... Class URL mapping DB, 12H ... Web application supply means, 12I ... Source code, 22A ... Web application inspection management Means, 22B: Web application execution inspection means, 22C: Request parameter DB, 22D: Response vulnerability determination DB, 22E: Inspection data DB, 22F: Result report.

Claims (2)

アプリケーション検査管理手段からの検査開始通知を受け、検査対象のアプリケーションのソースコードについて、ソースコード外部からのデータをその入力箇所ごとに区別し、変数の参照する値およびメソッドによる遷移を解析することで脆弱性の検査を行い、脆弱性の可能性のあるコードの位置およびその原因となるアプリケーション外部からのデータの入力位置と該データが経由するメソッドの情報を取得する第1のステップと、
前記第1のステップで検出した箇所について、アプリケーション供給手段が供給する検査対象アプリケーションに対し、検査のためのリクエストデータを送付し、そのレスポンスデータ及び予め登録している脆弱性判定コードと比較することにより、脆弱性が含まれるかどうかを判定し、脆弱であるものと、そうでないものを区別して出力する第2のステップを備えることを特徴とするアプリケーションの脆弱性検査方法。
By receiving the inspection start notification from the application inspection management means, for the source code of the application to be inspected, the data from outside the source code is distinguished for each input location, and the values referenced by the variables and the transitions by the method are analyzed A first step of inspecting a vulnerability and obtaining information on a position of a code having a potential vulnerability and an input position of data from the outside of the application and a method through which the data passes;
For the location detected in the first step, send request data for inspection to the inspection target application supplied by the application supply means, and compare the response data with the vulnerability determination code registered in advance. The application vulnerability inspection method comprising: a second step of determining whether or not a vulnerability is included, and distinguishing and outputting a vulnerable one.
アプリケーション検査管理手段からの検査開始通知を受け、検査対象のアプリケーションのソースコードについて、ソースコード外部からのデータをその入力箇所ごとに区別し、変数の参照する値およびメソッドによる遷移を解析することで脆弱性の検査を行い、脆弱性の可能性のあるコードの位置およびその原因となるアプリケーション外部からのデータの入力位置と該データが経由するメソッドの情報を取得する第1の手段と、
前記第1の手段で検出した箇所について、アプリケーション供給手段が供給する検査対象アプリケーションに対し、検査のためのリクエストデータを送付し、そのレスポンスデータ及びあらかじめ登録している脆弱性判定コードと比較することにより、脆弱性が含まれるかどうかを判定し、脆弱であるものと、そうでないものを区別して出力する第2の手段を備えることを特徴とするアプリケーションの脆弱性検査装置。
By receiving the inspection start notification from the application inspection management means, for the source code of the application to be inspected, the data from outside the source code is distinguished for each input location, and the values referenced by the variables and the transitions by the method are analyzed A first means for inspecting a vulnerability and obtaining information on a position of a code that may be vulnerable and an input position of data from the outside of the application that causes the vulnerability and a method through which the data passes;
For the location detected by the first means, send request data for inspection to the inspection target application supplied by the application supply means, and compare the response data with the vulnerability determination code registered in advance. The application vulnerability inspection apparatus comprising: a second means for determining whether or not a vulnerability is included, and distinguishing and outputting a vulnerable one.
JP2006050560A 2006-02-27 2006-02-27 Application vulnerability inspection method and apparatus Expired - Fee Related JP4587976B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006050560A JP4587976B2 (en) 2006-02-27 2006-02-27 Application vulnerability inspection method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006050560A JP4587976B2 (en) 2006-02-27 2006-02-27 Application vulnerability inspection method and apparatus

Publications (2)

Publication Number Publication Date
JP2007233432A JP2007233432A (en) 2007-09-13
JP4587976B2 true JP4587976B2 (en) 2010-11-24

Family

ID=38554009

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006050560A Expired - Fee Related JP4587976B2 (en) 2006-02-27 2006-02-27 Application vulnerability inspection method and apparatus

Country Status (1)

Country Link
JP (1) JP4587976B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9507933B2 (en) 2012-08-01 2016-11-29 Mitsubishi Electric Corporation Program execution apparatus and program analysis apparatus

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5253298B2 (en) * 2009-05-28 2013-07-31 三菱電機株式会社 Web application diagnosis apparatus, Web application diagnosis program, and Web application diagnosis method
JP2013182441A (en) * 2012-03-02 2013-09-12 Nec Corp Abnormal cause identification support system, abnormal cause identification support method and abnormal cause identification support program
US9501646B2 (en) 2012-09-26 2016-11-22 Mitsubishi Electric Corporation Program verification apparatus, program verification method, and computer readable medium
JP5941859B2 (en) * 2013-03-05 2016-06-29 株式会社エヌ・ティ・ティ・データ Verification device, verification method, and program
KR101876685B1 (en) * 2017-08-08 2018-07-10 엘에스웨어(주) SYSTEM FOR MANAGING vulnerability OF SOFTWARE USING SPDX TECHNOLOGY AND METHOD THEREOF
CN109508981A (en) * 2017-09-15 2019-03-22 富士通株式会社 Method and apparatus for testing intelligent contract

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005121953A1 (en) * 2004-06-04 2005-12-22 Fortify Software, Inc. Apparatus and method for developing, testing and monitoring secure software

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7240332B2 (en) * 2003-04-18 2007-07-03 Ounce Labs, Inc. Method and system for detecting vulnerabilities in source code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005121953A1 (en) * 2004-06-04 2005-12-22 Fortify Software, Inc. Apparatus and method for developing, testing and monitoring secure software

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9507933B2 (en) 2012-08-01 2016-11-29 Mitsubishi Electric Corporation Program execution apparatus and program analysis apparatus

Also Published As

Publication number Publication date
JP2007233432A (en) 2007-09-13

Similar Documents

Publication Publication Date Title
JP5507699B2 (en) Malignant site detection apparatus and method
JP4587976B2 (en) Application vulnerability inspection method and apparatus
US9747187B2 (en) Simulating black box test results using information from white box testing
TWI575397B (en) Point-wise protection of application using runtime agent and dynamic security analysis
JP2007241906A (en) Web application vulnerability dynamic inspection method and system
CN103699480A (en) WEB dynamic security flaw detection method based on JAVA
JPWO2006087780A1 (en) Vulnerability audit program, vulnerability audit device, vulnerability audit method
US8572747B2 (en) Policy-driven detection and verification of methods such as sanitizers and validators
US20150302191A1 (en) Program execution apparatus and program analysis apparatus
CN108959071B (en) RASP-based PHP deformation webshell detection method and system
US9645800B2 (en) System and method for facilitating static analysis of software applications
CN110958221B (en) Method and device for dynamically detecting injection vulnerability of XML external entity
US9392011B2 (en) Web vulnerability repair apparatus, web server, web vulnerability repair method, and program
Chen et al. DroidCIA: A novel detection method of code injection attacks on HTML5-based mobile apps
CN112035359A (en) Program testing method, program testing device, electronic equipment and storage medium
CN111884876A (en) Method, device, equipment and medium for detecting protocol type of network protocol
CN112925524A (en) Method and device for detecting unsafe direct memory access in driver
JP4170243B2 (en) Web application inspection device
Mostafa et al. Netdroid: Summarizing network behavior of android apps for network code maintenance
KR100924519B1 (en) File format analysis system and method for unknown file format to use software security testing
CN115310087A (en) Website backdoor detection method and system based on abstract syntax tree
US20200364336A1 (en) Method and system for identification of secure binary images
CN111338956A (en) Automatic pressure measurement method, device, equipment and storage medium
JP2021096685A (en) Test execution program, test execution method, and test execution device
CN116415244A (en) Project code testing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080708

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100907

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100907

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130917

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees