WO2023238239A1 - 修正装置、修正方法及び修正プログラム - Google Patents

修正装置、修正方法及び修正プログラム Download PDF

Info

Publication number
WO2023238239A1
WO2023238239A1 PCT/JP2022/022968 JP2022022968W WO2023238239A1 WO 2023238239 A1 WO2023238239 A1 WO 2023238239A1 JP 2022022968 W JP2022022968 W JP 2022022968W WO 2023238239 A1 WO2023238239 A1 WO 2023238239A1
Authority
WO
WIPO (PCT)
Prior art keywords
regular expression
unit
modification
regular
character strings
Prior art date
Application number
PCT/JP2022/022968
Other languages
English (en)
French (fr)
Inventor
忠賢 千田
悠太 岩城
Original Assignee
日本電信電話株式会社
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 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to PCT/JP2022/022968 priority Critical patent/WO2023238239A1/ja
Publication of WO2023238239A1 publication Critical patent/WO2023238239A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities

Definitions

  • Regular Expression Denial of Service is known as a cyber attack that exploits such shortcomings (Reference: "Regular Expression Denial of Service - ReDoS", https://owasp.org/www-community/attacks /Regular_expression_Denial_of_Service_-_ReDoS).
  • non-fragile regular expressions a regular expression that operates in linear time on a regular expression engine, relative to the length of the string to be matched, are referred to as non-fragile regular expressions.
  • a regular expression that operates on a regular expression engine in exponential time, for example, with respect to the length of the character string to be matched is called a weak regular expression.
  • Non-Patent Document 1 which corrects errors in languages accepted by regular expressions, is known as a technology for removing the threat of ReDoS. Furthermore, a method is known in which a pure regular expression is converted once into a deterministic finite automaton (Deterministic Finite Automaton) and then back to obtain a non-fragile regular expression (for example, see Non-Patent Document 2).
  • Non-Patent Document 1 corrects errors in regular expressions, but does not correct vulnerabilities.
  • the technology described in Non-Patent Document 2 does not support syntactic modifications such as lookahead, lookbehind, and backreference, which are extensions that are widely used in the real world.
  • the modification device includes an extraction unit that extracts a first regular expression from the source code, and a modification device that detects that the first regular expression is vulnerable to ReDoS.
  • the present invention is characterized in that it has a determining unit that determines whether or not a condition shown in the table is satisfied, and a synthesizing unit that synthesizes a second regular expression that does not satisfy the condition based on the first regular expression.
  • FIG. 1 is a diagram showing a configuration example of a correction device according to a first embodiment.
  • FIG. 2 is a diagram illustrating an example of the syntax of a regular expression.
  • FIG. 3 is a diagram illustrating a method for extracting a list of regular expressions.
  • FIG. 4 is a diagram showing an example of NFA.
  • FIG. 5 is a diagram showing an example of paths on the NFA.
  • FIG. 6 is a diagram showing examples of Positive Examples and Negative Examples.
  • FIG. 7 is a diagram illustrating a method of generating a set of character strings.
  • FIG. 8 is a diagram illustrating a regular expression synthesis method.
  • FIG. 9 is a flowchart showing the process flow of the correction device according to the first embodiment.
  • FIG. 10 is a flowchart showing the flow of regular expression modification processing.
  • FIG. 11 is a flowchart showing the flow of regular expression synthesis processing.
  • FIG. 12 is a diagram illustrating an example of a computer that executes
  • FIG. 1 is a diagram showing an example of the configuration of a correction device according to a first embodiment.
  • the modification device 10 receives input of source code, modifies the regular expression included in the input source code, and outputs the modified regular expression.
  • the correction device 10 includes an interface section 11, a storage section 12, and a control section 13.
  • the interface unit 11 is an interface for data input/output and data communication.
  • the interface unit 11 accepts data input from input devices such as a keyboard and a mouse. Further, for example, the interface unit 11 outputs data to an output device such as a display and a speaker.
  • the interface unit 11 may be a device (for example, a NIC (Network Interface Card)) for communicating via a network.
  • a NIC Network Interface Card
  • the storage unit 12 is a storage device such as an HDD (Hard Disk Drive), an SSD (Solid State Drive), or an optical disk. Note that the storage unit 12 may be a data-rewritable semiconductor memory such as a RAM (Random Access Memory), a flash memory, or an NVSRAM (Non Volatile Static Random Access Memory).
  • the storage unit 12 stores an OS (Operating System) and various programs executed by the modification device 10.
  • the storage unit 12 stores replacement candidate syntax information 121.
  • the replacement candidate syntax information 121 is a set of syntaxes of regular expressions to be replaced with range characters or holes in regular expressions or templates.
  • the replacement candidate syntax information 121 is " ⁇ , ⁇
  • " ⁇ " is a hole. The holes and templates will be described later.
  • the control unit 13 controls the entire correction device 10.
  • the control unit 13 includes, for example, electronic circuits such as a CPU (Central Processing Unit), an MPU (Micro Processing Unit), and a GPU (Graphics Processing Unit), an ASIC (Application Specific Integrated Circuit), and an FPGA (Field Programmable Gate). Array) etc. It is an integrated circuit.
  • control unit 13 has an internal memory for storing programs and control data that define various processing procedures, and executes each process using the internal memory. Further, the control unit 13 functions as various processing units by running various programs.
  • control unit 13 includes an extraction unit 131, a determination unit 132, a generation unit 133, and a synthesis unit 134.
  • the extraction unit 131 extracts the regular expression before modification from the source code. Further, the determining unit 132 determines whether the regular expression before modification satisfies a condition indicating that it is vulnerable to ReDoS. Then, the synthesis unit 134 synthesizes a modified regular expression that does not satisfy the conditions based on the unmodified regular expression.
  • the regular expression before modification is an example of the first regular expression.
  • the modified regular expression is an example of a second regular expression.
  • the synthesis unit 134 performs correction processing on regular expressions extracted from the source code by the extraction unit 131 and that are vulnerable to ReDoS. This prevents the synthesis unit 134 from performing modification processing on a regular expression that does not originally require modification.
  • the source code rather than the regular expression itself, needs to be input to the modification device 10, it is possible to omit the preliminary processing, such as extracting the regular expression from the source code in advance, for example.
  • the extraction unit 131 performs analysis on the AST and obtains a list of regular expressions (step S2). In this way, the extraction unit 131 can create a list including one or more extracted regular expressions.
  • the extraction unit 131 converts the source code into a parsing tree, and extracts the regular expression restored based on the variables extracted from the parsing tree as the regular expression before modification.
  • the extraction unit 131 traverses the AST and extracts a regular expression in the source code, a variable name of each variable, and a set of values.
  • the generation unit 133 generates Positive Examples, which is a set of character strings accepted by the regular expression before modification, and Negative Examples, which is a set of character strings rejected by the regular expression before modification.
  • the generation unit 133 replaces the back reference with the regular expression in the capture that the back reference refers to. If the capture includes another backreference, first replace that backreference with the regular expression of the capture that the backreference refers to. This removes backreferences from the regular expression, allowing Thompson construction.
  • the generation unit 133 converts the regular expression from which back references are removed during capture into NFA using the Thompson construction method.
  • FIG. 4 is a diagram showing an example of NFA.
  • FIG. 5 is a diagram showing an example of paths on the NFA. Double circles in FIGS. 4 and 5 are nodes in an accepting state.
  • the generation unit 133 traces the NFA path and generates an example. Since the path a ⁇ c and the path b ⁇ d (dashed lines in FIG. 5) reach the acceptance state, the generation unit 133 generates a set of Positive Examples ⁇ ac, bd ⁇ . On the other hand, since path a and path b (dotted chain line in FIG. 5) do not reach the acceptance state, the generation unit 133 generates a set of Negative Examples ⁇ a, b ⁇ .
  • the generation unit 133 enumerates all character strings that are combinations of characters of a certain length or less, and if each character string is accepted by the regular expression, it is classified as Positive Examples, and if it is rejected, it is classified as Negative Examples. can. Note that the generation unit 133 may generate Positive Examples and Negative Examples using the method described in Non-Patent Document 1.
  • FIG. 7 is a diagram illustrating a method of generating a set of character strings.
  • the regular expression before modification is ".*.*@example[.]com”.
  • the generation unit 133 generates character strings “@example.com”, “a@example.com”, and “gc@example.com” that are accepted by the regular expression “.*.*@example[.]com”. Classify as Positive Examples.
  • the generation unit 133 generates character strings such as "example.com”, “@.com”, “@examplecom”, “@example.”, etc. that are rejected by the regular expression ".*.*@example[.]com”. Classify as Negative Examples.
  • the processing by the synthesis unit 134 is broadly divided into a step of creating a template and a step of assigning to the template.
  • the synthesis unit 134 creates a template by replacing range characters in the regular expression with placeholders.
  • the synthesis unit 134 assigns a predetermined syntax to the placeholder and synthesizes a non-fragile regular expression.
  • the placeholder will be referred to as a hole and will be written as " ⁇ ".
  • the synthesis unit 134 performs processing while holding the priority queue. Templates stored in the queue are given priority according to their proximity to the regular expression before modification. For example, a template that is closer to the regular expression before modification is given a higher priority. Further, the closeness to the regular expression may be expressed by the sum of the sizes of different subtrees between the ASTs of the regular expression (for example, see Non-Patent Document 1).
  • the synthesis unit 134 When extracting elements from the queue, the synthesis unit 134 preferentially extracts the one with the highest priority among the stored templates. At the start of the process, the synthesis unit 134 stores the unmodified regular expression in a queue as a template. Note that the regular expression stored in the queue before modification necessarily has the highest priority.
  • the synthesis unit 134 searches for assignment of range characters that satisfy the conditions to the holes included in the template. For example, the synthesis unit 134 performs the search using a Satisfiability Modulo Theories (SMT) solver (for example, Z3 solver).
  • SMT Satisfiability Modulo Theories
  • a regular expression that operates in linear time on a regular expression engine with respect to the length of a character string to be matched is referred to as a non-fragile regular expression.
  • regular expressions that operate in exponential time on a regular expression engine, depending on the length of the string to be matched are called weak regular expressions.
  • the synthesis of non-weak regular expressions by the synthesis unit 134 is based on the strongly one-unambiguous method devised by Koch and Scherzinger et al. (Reference: Christoph Koch and Stefanie Scherzinger. 2007. Attribute Grammars for Scalable Query Processing on XML). Streams. The VLDB Journal 16 , 3 (July 2007), 317-342.), which has been improved to suit the expansion of the real world.
  • Strongly one-unambiguous means that the next operation to be processed by the regular expression engine is uniquely determined once the character currently being analyzed is determined.
  • FIG. 9 is a flowchart showing the process flow of the correction device according to the first embodiment. As shown in FIG. 9, the modification device 10 first receives input of source code (step S11).
  • the modification device 10 extracts a regular expression from the source code (step S12). For example, the modification device 10 extracts a regular expression using a parsing function compatible with the programming language in which the source code is written.
  • step S13, No If the extracted regular expression is not vulnerable to ReDoS (step S13, No), the modification device 10 ends the process.
  • the modification device 10 modifies the regular expression determined to be vulnerable to ReDoS (Step S13, Yes) (Step S14).
  • the modification device 10 outputs the modified regular expression (step S15).
  • the modification device 10 generates a set of character strings (Positive Examples) that are accepted according to the input regular expression (step S142). Furthermore, the modification device 10 generates a set of character strings (Negative Examples) that are rejected by the input regular expression (step S143).
  • the modification device 10 generates (synthesizes) a regular expression based on the input regular expression, accepted character strings, and rejected character strings (step S144). Then, the modification device 10 outputs the generated regular expression (step S145).
  • the extraction unit 131 converts the source code into a parsing tree, and extracts a regular expression restored based on the variables extracted from the parsing tree as a first regular expression. In this way, the regular expressions used when actually executing the program can be dynamically restored, making it possible to cover all regular expressions to be modified.
  • the generation unit 133 converts the first regular expression into a non-deterministic finite automaton, and generates a set of character strings obtained by a path that reaches an acceptance state among the paths on the non-deterministic finite automaton as a first set. Then, among the paths on the non-deterministic finite automaton, a set of character strings obtained by paths that do not reach the acceptance state is generated as a second set. Thereby, regular expressions to be modified can be comprehensively acquired.
  • each component of each device shown in the drawings is functionally conceptual, and does not necessarily need to be physically configured as shown in the drawings.
  • the specific form of distributing and integrating each device is not limited to what is shown in the diagram, and all or part of the devices may be functionally or physically distributed or integrated in arbitrary units depending on various loads and usage conditions. Can be integrated and configured.
  • each processing function performed by each device is realized in whole or in part by a CPU (Central Processing Unit) and a program that is analyzed and executed by the CPU, or by hardware using wired logic. It can be realized as Note that the program may be executed not only by the CPU but also by another processor such as a GPU.
  • a CPU Central Processing Unit
  • the modification device 10 can be implemented by installing a modification program that executes the above modification process on a desired computer as packaged software or online software. For example, by causing the information processing device to execute the above modification program, the information processing device can be made to function as the modification device 10.
  • the information processing device referred to here includes a desktop or notebook personal computer.
  • information processing devices include mobile communication terminals such as smartphones, mobile phones, and PHSs (Personal Handyphone Systems), as well as slate terminals such as PDAs (Personal Digital Assistants).
  • the modification device 10 can also be implemented as a modification server device that uses a terminal device used by a user as a client and provides services related to the above-mentioned modification processing to the client.
  • the modification server device is implemented as a server device that provides a modification service that takes source code as input and outputs a modified regular expression.
  • the correction server device may be implemented as a Web server or may be implemented as a cloud that provides services related to the above correction processing by outsourcing.
  • FIG. 12 is a diagram showing an example of a computer that executes a modification program.
  • Computer 1000 includes, for example, a memory 1010 and a CPU 1020.
  • the computer 1000 also includes a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. These parts are connected by a bus 1080.
  • the memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM (Random Access Memory) 1012.
  • the ROM 1011 stores, for example, a boot program such as BIOS (Basic Input Output System).
  • Hard disk drive interface 1030 is connected to hard disk drive 1090.
  • Disk drive interface 1040 is connected to disk drive 1100.
  • Serial port interface 1050 is connected to, for example, mouse 1110 and keyboard 1120.
  • Video adapter 1060 is connected to display 1130, for example.
  • the hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, a program that defines each process of the modification device 10 is implemented as a program module 1093 in which computer-executable code is written.
  • Program module 1093 is stored in hard disk drive 1090, for example.
  • a program module 1093 for executing processing similar to the functional configuration of the modification device 10 is stored in the hard disk drive 1090.
  • the hard disk drive 1090 may be replaced by an SSD (Solid State Drive).
  • the setting data used in the processing of the embodiment described above is stored as program data 1094 in, for example, the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads out the program module 1093 and program data 1094 stored in the memory 1010 and the hard disk drive 1090 to the RAM 1012 as necessary, and executes the processing of the embodiment described above.
  • program module 1093 and the program data 1094 are not limited to being stored in the hard disk drive 1090, but may be stored in a removable storage medium, for example, and read by the CPU 1020 via the disk drive 1100 or the like.
  • the program module 1093 and the program data 1094 may be stored in another computer connected via a network (LAN (Local Area Network), WAN (Wide Area Network), etc.). The program module 1093 and program data 1094 may then be read by the CPU 1020 from another computer via the network interface 1070.
  • LAN Local Area Network
  • WAN Wide Area Network
  • correction device 11 interface unit 12 storage unit 13 control unit 121 replacement candidate syntax information 131 extraction unit 132 determination unit 133 generation unit 134 synthesis unit

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

実施形態に係る修正装置は、抽出部と、判定部と、合成部と、を有する。抽出部は、ソースコードから第1の正規表現を抽出する。判定部は、第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する。合成部は、第1の正規表現を基に、条件を満たさない第2の正規表現を合成する。

Description

修正装置、修正方法及び修正プログラム
 本発明は、修正装置、修正方法及び修正プログラムに関する。
 実世界において正規表現は正規表現エンジンとして実装され、様々な場面で利用されている。例えば、正規表現エンジンは、emailアドレスを入力する画面を持つウェブアプリケーションにおいて、ユーザが入力した文字列がemailアドレスかどうかを確認するために用いられている。また、例えば、正規表現エンジンは、外部から送られてきたデータのサニタイズや要素の抽出、汎用的なプログラミング言語の標準ライブラリ等に採用されている。
 ここで、多くの正規表現エンジンに採用されているバックトラッキング法に基づいた解析アルゴリズムは、解析対象のデータと正規表現の組み合わせによっては処理に膨大な時間を要するという欠点がある。そのような欠点を悪用したサイバー攻撃としてRegular Expression Denial of Service(ReDoS)が知られている(参考文献:"Regular expression Denial of Service - ReDoS", https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)。
 なお、マッチさせる文字列の長さに対して、正規表現エンジン上で線形時間で動作するような正規表現を脆弱でない正規表現と呼ぶものとする。逆に、マッチさせる文字列の長さに対して、正規表現エンジン上で例えば指数関数時間で動作するような正規表現を脆弱な正規表現と呼ぶものとする。
 従来、ReDoSの脅威を取り除くための技術として、正規表現の受理する言語の誤りを修正するRFixer(例えば、非特許文献1を参照)が知られている。また、純粋な正規表現を決定性有限オートマトン(Deterministic Finite Automaton)に一度変換して戻すことで脆弱でない正規表現を得る方法(例えば、非特許文献2を参照)が知られている。
Rong Pan, Qinheping Hu, Gaowei Xu, and Loris D’Antoni. 2019. Automatic Repair of Regular Expressions. Proc. ACM Program. Lang. 3, OOPSLA, Article 139 (Oct. 2019), 29 pages. Brink van der Merwe, Nicolaas Weideman, and Martin Berglund. 2017. Turning Evil Regexes Harmless. In Proceedings of the South African Institute of Computer Scientists and Information Technologists (SAICSIT’17). Association for Computing Machinery, New York, NY, USA, Article 38, 10 pages.
 しかしながら、従来の技術には、実世界で利用されている正規表現の脆弱性を効率良く修正することが困難な場合があるという問題がある。
 例えば、非特許文献1に記載の技術は、正規表現の誤りを修正するものであり、脆弱性を修正するものではない。また、例えば、非特許文献2に記載の技術は、は実世界で広く利用されている拡張である先読み、後読み及び後方参照といった構文の修正に対応していない。
 また、実用上では、正規表現エンジンが使われるプログラムのソースコード上に脆弱な正規表現が用いられることがある。これに対し、従来の技術は、ソースコード中の脆弱な正規表現修正に特化していない。
 上述した課題を解決し、目的を達成するために、修正装置は、ソースコードから第1の正規表現を抽出する抽出部と、前記第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する判定部と、前記第1の正規表現を基に、前記条件を満たさない第2の正規表現を合成する合成部と、を有することを特徴とする。
 本発明によれば、実世界で利用されている正規表現の脆弱性を効率良く修正することができる。
図1は、第1の実施形態に係る修正装置の構成例を示す図である。 図2は、正規表現の構文の例を示す図である。 図3は、正規表現のリストの抽出方法を説明する図である。 図4は、NFAの例を示す図である。 図5は、NFA上のパスの例を示す図である。 図6は、Positive ExamplesとNegative Examplesの例を示す図である。 図7は、文字列の集合の生成方法を説明する図である。 図8は、正規表現の合成方法を説明する図である。 図9は、第1の実施形態に係る修正装置の処理の流れを示すフローチャートである。 図10は、正規表現の修正処理の流れを示すフローチャートである。 図11は、正規表現の合成処理の流れを示すフローチャートである。 図12は、修正プログラムを実行するコンピュータの一例を示す図である。
 以下に、本願に係る修正装置、修正方法及び修正プログラムの実施形態を図面に基づいて詳細に説明する。なお、本発明は、以下に説明する実施形態により限定されるものではない。
[第1の実施形態の構成]
 まず、図1を用いて、第1の実施形態に係る修正装置の構成について説明する。図1は、第1の実施形態に係る修正装置の構成の一例を示す図である。図1に示すように、修正装置10は、ソースコードの入力を受け付け、入力されたソースコードに含まれる正規表現の修正を行い、修正後の正規表現を出力する。
 ここで、本実施形態における正規表現は、実世界の拡張を施した正規表現であって、バッカスナウア記法(BNF:Backus-Naur form)で定義された構文に従うものとする。図2は、正規表現の構文の例を示す図である。図2の正規表現rは、本実施形態における正規表現の一例である。なお、以降の説明において、正規表現中の「\」は適宜バックスラッシュに置き換えられてもよい。
 図2の「C」は文字の集合であり、「x」は文字列、「i」は自然数である。図2の構文は既存の正規表現エンジンで利用されているものである(参考文献:"Perldoc Browser", https://perldoc.perl.org/perlre.html)。
 また、「.」は任意の1文字を表す記号である。つまり、「.」は図2の範囲文字「[C]」と糖衣構文である。また、範囲文字「[C]」にマッチしない文字の集合は、「[^C]」と書ける。また、空集合は「[]」と表記され、任意の文字にマッチしないことを意味する。
 図1に戻り、修正装置10の各部について説明する。図1に示すように、修正装置10は、インタフェース部11、記憶部12及び制御部13を有する。
 インタフェース部11は、データの入出力及びデータの通信を行うためのインタフェースである。例えば、インタフェース部11は、キーボード及びマウス等の入力装置からデータの入力を受け付ける。また、例えば、インタフェース部11は、ディスプレイ及びスピーカ等の出力装置にデータを出力する。
 また、インタフェース部11は、ネットワークを介して通信を行うための装置(例えばNIC(Network Interface Card))であってもよい。
 記憶部12は、HDD(Hard Disk Drive)、SSD(Solid State Drive)、光ディスク等の記憶装置である。なお、記憶部12は、RAM(Random Access Memory)、フラッシュメモリ、NVSRAM(Non Volatile Static Random Access Memory)等のデータを書き換え可能な半導体メモリであってもよい。記憶部12は、修正装置10で実行されるOS(Operating System)や各種プログラムを記憶する。
 記憶部12は、置換候補構文情報121を記憶する。置換候補構文情報121は、正規表現又はテンプレートの、範囲文字又はホールと置換される正規表現の構文の集合である。
 例えば、置換候補構文情報121は、「□□, □|□, □*, (□), \i, (?=□), (?!□), (?<=□), (?<!□)」である。ただし、「□」はホールである。ホール及びテンプレートについては後述する。
 制御部13は、修正装置10全体を制御する。制御部13は、例えば、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、GPU(Graphics Processing Unit)等の電子回路や、ASIC(Application Specific Integrated Circuit)、FPGA(Field Programmable Gate Array)等の集積回路である。
 また、制御部13は、各種の処理手順を規定したプログラムや制御データを格納するための内部メモリを有し、内部メモリを用いて各処理を実行する。また、制御部13は、各種のプログラムが動作することにより各種の処理部として機能する。例えば、制御部13は、抽出部131、判定部132、生成部133及び合成部134を有する。
 抽出部131は、ソースコードから修正前の正規表現を抽出する。また、判定部132は、修正前の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する。そして、合成部134は、修正前の正規表現を基に、条件を満たさない修正後の正規表現を合成する。
 なお、修正前の正規表現は第1の正規表現の一例である。また、修正後の正規表現は第2の正規表現の一例である。
 このように、合成部134は、抽出部131によってソースコードから抽出された正規表現であって、ReDoSに対して脆弱である正規表現を対象として修正処理を行う。これにより、合成部134が本来修正が不必要な正規表現に対して修正処理を行うことが防止される。
 さらに、修正装置10には正規表現そのものではなくソースコードが入力されればよいので、例えば事前にソースコードから正規表現を抽出するといった前段階の処理が省略可能になる。
 図3は、正規表現のリストの抽出方法を説明する図である。図3に示すように、まず、抽出部131は、ソースコードの構文解析を行い構文解析木(例えば、AST((Abstract Syntax Tree)))を構築する(ステップS1)。
 抽出部131は、ソースコードを記述しているプログラミング言語に応じて提供されている構文解析機能を用いてソースコードの解析を行うことができる。例えば、プログラミング言語がPythonであれば、抽出部131はANTLR(ANother Tool for Language Recognition)(参考文献:https://www.antlr.org/)を用いてソースコードの解析を行う。
 さらに、抽出部131は、AST上の解析を行い、正規表現のリストを得る(ステップS2)。このように、抽出部131は、抽出した1つ以上の正規表現を含むリストを作成することができる。
 抽出部131は、ソースコードを構文解析木に変換し、構文解析木から抽出された変数を基に復元した正規表現を修正前の正規表現として抽出する。
 まず、抽出部131は、AST上をトラバースし、ソースコードにおける正規表現、各変数の変数名及び値の集合を抽出する。
 ソースコードを基にしたプログラムが実行される際には、正規表現が、変数の組み合わせによって生成される場合がある。そこで、抽出部131は、変数名及び値の集合を基に、正規表現を復元する。
 プログラム言語であるPythonにより記述された下記のソースコードを例に挙げて、抽出部131が正規表現を復元する処理を具体的に説明する。なお、説明のため、ソースコードの各行の左端には、行を区別するための番号が付されている。
(ソースコード)
  1:    Import re
  2:    if input() == “example”:
  3:        s = “example.com”
  4:    else:
  5:        s = “example.com/abc”
  6:    r = ‘http://’ + s + “.*/index[.]html”
  7:    re.match(r, input())
 この場合、正規表現rの値は、変数sの値との組み合わせで決まる。そのため、2行目から始まるif文中のinput()の値が定まるまで正規表現rは定まらない。
 抽出部131は、変数(名)sに対応する値の集合{“example.com”,“example.com/abc”}を抽出し、当該集合を使って正規表現rを復元する。
 この場合、抽出部131は、正規表現rとして、「http://example.com.*/index[.]html」及び「http://example.com/abc.*index[.]html」を復元し、当該正規表現を抽出する。
 判定部132は、正規表現がRWS1U(参考文献:"Repairing DoS Vulnerability of Real-World Regexes",https://www.computer.org/csdl/proceedings-article/sp/2022/131600b049/1A4Q3TnrBZK)を満たす場合、ReDoSに対して脆弱でないと判定する。一方、判定部132は、正規表現がRWS1Uを満たさない場合、ReDoSに対して脆弱であると判定する。
 生成部133は、正規表現のリストに含まれる正規表現のうち、判定部132によってReDoSに対して脆弱であると判定されたものを対象として以下の処理を行う。
 生成部133は、修正前の正規表現によって受理される文字列の集合であるPositive Examples、及び、修正前の正規表現によって拒否される文字列の集合であるNegative Examplesを生成する。
 なお、Positive Examplesは第1の集合の一例である。また、Negative Examplesは第2の集合の一例である。
 生成部133は、修正前の正規表現を非決定性有限オートマトン(NFA:Nondeterministic Finite Automaton)に変換し、非決定性有限オートマトン上のパスのうち、受理状態に到達するパスにより得られた文字列の集合をPositive Examplesとして生成し、非決定性有限オートマトン上のパスのうち、受理状態に到達しないパスにより得られた文字列の集合をNegative Examplesとして生成する。
 生成部133は、Thompson構成法を用いてNFAを構築する。ただし、正規表現に含まれるキャプチャと後方参照はThompson構成法では扱えないため、生成部133は、Over approximationにより、後方参照を当該後方参照が参照するキャプチャの中の正規表現に置換する。
 例えば、生成部133は、正規表現「(a*b)(c\1)\2」について、キャプチャ(「(c\1)」)中の後方参照である「\1」を「a*b」に置換し、「(a*b)(ca*b)\2」を得る。さらに、生成部133は、後方参照「\2」を「ca*b」に置換し、「(a*b)(ca*b)ca*b」を得る。なお、キャプチャは、Thompson構成法においてグルーピングとして扱われるのでそのままとする。
 このように、生成部133は、後方参照を当該後方参照が参照するキャプチャの中の正規表現に置換する。キャプチャが別の後方参照を含む場合は、先に当該後方参照を、当該後方参照が参照するキャプチャの正規表現に置換する。これにより後方参照が正規表現から消えるため、Thompson構成法が利用可能となる。
 生成部133は、キャプチャ中の後方参照を除去した正規表現をThompson構成法によりNFAに変換する。図4は、NFAの例を示す図である。図5は、NFA上のパスの例を示す図である。図4及び図5の中の二重丸は受理状態のノードである。
 生成部133は、NFAのパスをたどり例を生成する。パスa→c、及びパスb→d(図5の破線)は受理状態に到達するため、生成部133は、Positive Examplesの集合{ac,bd}を生成する。一方、パスa、及びパスb(図5の一点鎖線)は受理状態に到達しないため、生成部133は、Negative Examplesの集合{a,b}を生成する。
 なお、生成部133は、幅優先探索、深さ優先探索等の既知の探索アルゴリズムを利用してパスを列挙することができる。ただし、NFA上にループがある場合、生成部133は、通ったパスを記録しておき、同じパスを2度以上通ることがないようにしておく。
 図6は、Positive ExamplesとNegative Examplesの例を示す図である。ここでは、修正前の正規表現が「.*.*=.*」であるものとする。このとき、Positive Examplesに含まれる「=」、「abcd==」、「==abcd」及び「ab=c」は正規表現「.*.*=.*」にマッチする(受理される)。一方、Negative Examplesに含まれる「abc」は正規表現「.*.*=.*」にマッチしない(拒否される)。
 生成部133は、特定の長さ以下の文字を組み合わせた文字列を全列挙し、各文字列が正規表現に受理されるならPositive Examplesに分類し、拒否されるならNegative Examplesに分類することができる。なお、生成部133は、非特許文献1に記載の方法を用いてPositive ExamplesとNegative Examplesを生成してもよい。
 ここで、文字列を素直に全列挙すると、爆発的に例が生成されてしまう。これを回避するために、生成部133は、修正前の正規表現の中に現れる文字のみからPositive Examplesの文字列及びNegative Examplesの文字列を生成してもよい。
 例えば、正規表現が「ab[c-d]*」である場合、生成部133は、「a」及び「b」と、「[c,d]」からランダムに選択した1文字と、を組み合わせて候補の文字列を生成する。
 図7は、文字列の集合の生成方法を説明する図である。図7の例では、修正前の正規表現は「.*.*@example[.]com」である。この場合、生成部133は、正規表現「.*.*@example[.]com」によって受理される文字列「@example.com」、「a@example.com」、「gc@example.com」をPositive Examplesに分類する。一方、生成部133は、正規表現「.*.*@example[.]com」によって拒否される文字列「example.com」、「@.com」、「@examplecom」、「@example.」等をNegative Examplesに分類する。
 合成部134は、修正前の正規表現における範囲文字を所定の構文に置換した正規表現であって、Positive Examplesの文字列を受理し、かつNegative Examplesの文字列を拒否するような正規表現である修正後の正規表現を合成する。
 合成部134による処理は大きく、テンプレートを作成するステップと、テンプレートへの割り当てを行うステップと、に分けられる。
 テンプレートを作成するステップでは、合成部134は、正規表現における範囲文字をプレースホルダを使って置換することによりテンプレートを作成する。
 テンプレートへの割り当てを行うステップでは、合成部134は、プレースホルダへ所定の構文を割り当てて、脆弱でない正規表現を合成する。以降、プレースホルダをホールと呼び、「□」と表記する。
 合成部134は、優先度付きキューを保持しつつ処理を行う。キューに格納されたテンプレートには、修正前の正規表現への近さに応じて優先度が付与される。例えば、修正前の正規表現に近いテンプレートほど高い優先度が付与される。また、正規表現への近さは、正規表現のAST間の違う部分木のサイズの総和によって表されてもよい(例えば、非特許文献1を参照)。
 合成部134は、キューから要素を取り出す際には、格納されているテンプレートのうち優先度が最も高いものを優先して取り出す。処理の開始時点では、合成部134は、修正前の正規表現をテンプレートとしてキューに格納する。なお、キューに格納された修正前の正規表現の優先度は必然的に最高になる。
 まず、合成部134によって実行されるテンプレートを作成するステップについて説明する。合成部134は、キューから取り出したテンプレートが範囲文字を含む場合、当該テンプレートに含まれる当該範囲文字をホールに置換する。なお、範囲文字は、例えば「[C]」又は「.」のように表される。一方、合成部134は、キューから取り出したテンプレートがホールを含む場合、当該ホールのうちいずれか1つを、所定の構文に置換してもよい。
 例えば、合成部134は、テンプレートとしてキューに格納されている修正前の正規表現「.*.*=.*」の範囲文字を置換したテンプレート「□*.*=.*」、「.*□*=.*」「.*.*=□*」を作成し、キューに格納する。なお、一度取り出されたテンプレートは破棄されるものとする。
 このように、合成部134は、修正前の正規表現における範囲文字の少なくとも一部をホールに置換し、当該置換したホールをさらに所定の構文に置換したテンプレートを基に修正後の正規表現を合成する。
 さらに、合成部134は、ホールを、置換候補構文情報121に含まれる「□□」、「□|□」、「□*」、「(□)」、「\i」、「(?=□)」、「(?!□)」、「(?<=□)」、「(?<!□)」といった構文に置換することができる。この場合、合成部134は、テンプレートに含まれるホールを、ホールを含む所定の構文である「□□」、「□|□」、「□*」、「(□)」、「\i」、「(?=□)」、「(?!□)」、「(?<=□)」、「(?<!□)」のいずれかに置換したテンプレート(ただし、□はホール)を基に修正後の正規表現を合成する。
 続いて、合成部134によって実行されるテンプレートへの割り当てを行うステップについて説明する。ここでは、合成部134がテンプレートを作成するステップを繰り返し、例えばテンプレート「□*□*=.*」を作成しキューに格納したものとする。例えば、合成部134は、テンプレート「□*.*=.*」の左辺の範囲文字「.」をホールに置換することでテンプレート「□*□*=.*」を得る。
 合成部134は、テンプレートが含むホールに対する、条件を満たす範囲文字の割り当てを探索する。例えば、合成部134は、Satisfiability Modulo Theories(SMT) solver(例えば、Z3 solver)等を用いて探索を行う。
 合成部134は、テンプレートが「□*□*=.*」であり、Positive Examples及びNegative Examplesが図6の通りであれば、「[]*[^=]*=.*」という割り当てを探索により得ることができる。合成部134は、空集合である「[]」を取り除き、正規表現「[^=]*=.*」を得る。
 正規表現「[^=]*=.*」は、図6のPositive Examplesを受理し、Negative Examplesを拒否する。また、正規表現「[^=]*=.*」は、同じ文字にマッチする箇所を高々1つしか含まないため、脆弱でない性質を持っているということができる。
 本実施形態では、前述の通り、マッチさせる文字列の長さに対して、正規表現エンジン上で線形時間で動作するような正規表現を脆弱でない正規表現と呼ぶ。逆に、マッチさせる文字列の長さに対して、正規表現エンジン上で例えば指数関数時間で動作するような正規表現を脆弱な正規表現と呼ぶ。
 合成部134による脆弱でない正規表現の合成は、KochとScherzingerらにより考案されたstrongly one-unambiguous(参考文献:Christoph Koch and Stefanie Scherzinger. 2007. Attribute Grammars for Scalable Query Processing on XML Streams. The VLDB Journal 16, 3 (July 2007), 317-342.)という性質を実世界の拡張にも合わせて改良した性質を用いたものである。
 Strongly one-unambiguousとは、正規表現エンジンが次に処理する演算は現在解析中の文字が何か定まれば一意に定まるという性質である。
 同様に、修正前の正規表現が「.*.*@example[.]com」である場合、図8に示すように、合成部134は、脆弱でない正規表現「[^@]*@example[.]com」を得ることができる。
[第1の実施形態の処理]
 図9は、第1の実施形態に係る修正装置の処理の流れを示すフローチャートである。図9に示すように、まず、修正装置10は、ソースコードの入力を受け付ける(ステップS11)。
 次に、修正装置10は、ソースコードから正規表現を抽出する(ステップS12)。例えば、修正装置10は、ソースコードを記述しているプログラミング言語に対応した構文解析機能を用いて正規表現を抽出する。
 続いて、修正装置10は、抽出した正規表現が、ReDoSに対して脆弱であるか否かを判定する(ステップS13)。
 抽出した正規表現がReDoSに対して脆弱でない場合(ステップS13、No)、修正装置10は処理を終了する。
 そして、修正装置10は、ReDoSに対して脆弱である(ステップS13、Yes)と判定された正規表現を修正する(ステップS14)。修正装置10は、修正した正規表現を出力する(ステップS15)。
 図10は、第1の実施形態に係る修正装置の処理の流れを示すフローチャートである。図10の処理は、図9のステップS14に相当する。まず、修正装置10は、正規表現の入力を受け付ける(ステップS141)。
 次に、修正装置10は、入力された正規表現によって受理される文字列の集合(Positive Examples)を生成する(ステップS142)。また、修正装置10は、入力された正規表現によって拒否される文字列の集合(Negative Examples)を生成する(ステップS143)。
 例えば、修正装置10は、入力された修正前の正規表現から拡張オートマトンを作成し、当該拡張オートマトンのパスを全てカバーするように文字列の集合を生成することができる。
 続いて、修正装置10は、入力された正規表現、受理される文字列及び拒否される文字列を基に正規表現を生成(合成)する(ステップS144)。そして、修正装置10は、生成した正規表現を出力する(ステップS145)。
 図11は、正規表現の合成処理の流れを示すフローチャートである。図11の処理は、図10のステップS144に相当する。まず、修正装置10は、入力された正規表現を、テンプレートとしてキューに格納する(ステップS1441)。
 次に、修正装置10は、入力された正規表現に最も近いテンプレートをキューから取得する(ステップS1442)。
 続いて、修正装置10は、修正装置10は、受理される文字列を受理し、拒否される文字列を拒否し、かつ脆弱性に関する条件を満たすような、ホールへの範囲文字の割り当てを探索する(ステップS1443)。
 修正装置10は、探索結果の割り当てが存在するか否かを判定する(ステップS1444)。探索結果の割り当てが存在しない場合(ステップS1444、No)、修正装置10は、範囲文字をホールに置換するか、又はホールを所定のパターンに置換する(ステップS1445)。所定のパターンは、例えば「□□」、「□|□」、「□*」、「(□)」、「\i」、「(?=□)」、「(?!□)」、「(?<=□)」、「(?<!□)」といった構文である。なお、ステップS1441でキューに格納された、入力された正規表現がステップS1443での探索の対象となった場合、ステップS1444では割り当てが存在しないもの(No)とみなされる。
 そして、修正装置10は、ステップS1445で処理済みのテンプレートをキューに格納する(ステップS1446)。ここでの処理済みのテンプレートは、範囲文字がホールに置換されたテンプレート、又はホールが所定のパターンに置換されたテンプレートである。
 一方、探索結果の割り当てが存在する場合(ステップS1444、Yes)、修正装置10は、探索結果の割り当てを基に脆弱でない正規表現を合成する(ステップS1447)。
[第1の実施形態の効果]
 これまで説明してきたように、修正装置10の抽出部131は、ソースコードから第1の正規表現を抽出する。判定部132は、第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する。合成部134は、第1の正規表現を基に、条件を満たさない第2の正規表現を合成する。これにより、実世界で利用されている正規表現の脆弱性を効率良く修正することができる。例えば、事前にソースコードから正規表現を抽出しておく処理を省略することができる。
 さらに、実施形態には、ReDoS攻撃の対象となるWebアプリケーションのソースコードの検査といった実用的な利用方法が可能となる。さらに、実施形態は、Webアプリケーションのセキュリティのテスト及び診断等に活用できる。
 また、抽出部131は、ソースコードを構文解析木に変換し、構文解析木から抽出された変数を基に復元した正規表現を第1の正規表現として抽出する。このように、実際にプログラムを実行する際に使われる正規表現を動的に復元することができ、修正対象の正規表現を網羅することができるようになる。
 また、生成部133は、第1の正規表現によって受理される文字列の集合である第1の集合、及び、第1の正規表現によって拒否される文字列の集合である第2の集合を生成する。合成部134は、第1の正規表現における範囲文字を所定の構文に置換した正規表現であって、第1の集合の文字列を受理し、かつ第2の集合の文字列を拒否するような正規表現である第2の正規表現を合成する。このような処理を行う際に、ReDoSに対して脆弱な正規表現を絞り込んでおくことで、処理を効率化できる。
 生成部133は、第1の正規表現を非決定性有限オートマトンに変換し、非決定性有限オートマトン上のパスのうち、受理状態に到達するパスにより得られた文字列の集合を第1の集合として生成し、非決定性有限オートマトン上のパスのうち、受理状態に到達しないパスにより得られた文字列の集合を第2の集合として生成する。これにより、修正対象の正規表現を網羅的に取得することができる。
[システム構成等]
 また、図示した各装置の各構成要素は機能概念的なものであり、必ずしも物理的に図示のように構成されていることを要しない。すなわち、各装置の分散及び統合の具体的形態は図示のものに限られず、その全部又は一部を、各種の負荷や使用状況等に応じて、任意の単位で機能的又は物理的に分散又は統合して構成することができる。さらに、各装置にて行われる各処理機能は、その全部又は任意の一部が、CPU(Central Processing Unit)及び当該CPUにて解析実行されるプログラムにて実現され、あるいは、ワイヤードロジックによるハードウェアとして実現され得る。なお、プログラムは、CPUだけでなく、GPU等の他のプロセッサによって実行されてもよい。
 また、本実施形態において説明した各処理のうち、自動的に行われるものとして説明した処理の全部又は一部を手動的に行うこともでき、あるいは、手動的に行われるものとして説明した処理の全部又は一部を公知の方法で自動的に行うこともできる。この他、上記文書中や図面中で示した処理手順、制御手順、具体的名称、各種のデータやパラメータを含む情報については、特記する場合を除いて任意に変更することができる。
[プログラム]
 一実施形態として、修正装置10は、パッケージソフトウェアやオンラインソフトウェアとして上記の修正処理を実行する修正プログラムを所望のコンピュータにインストールさせることによって実装できる。例えば、上記の修正プログラムを情報処理装置に実行させることにより、情報処理装置を修正装置10として機能させることができる。ここで言う情報処理装置には、デスクトップ型又はノート型のパーソナルコンピュータが含まれる。また、その他にも、情報処理装置にはスマートフォン、携帯電話機やPHS(Personal Handyphone System)等の移動体通信端末、さらには、PDA(Personal Digital Assistant)等のスレート端末等がその範疇に含まれる。
 また、修正装置10は、ユーザが使用する端末装置をクライアントとし、当該クライアントに上記の修正処理に関するサービスを提供する修正サーバ装置として実装することもできる。例えば、修正サーバ装置は、ソースコードを入力とし、修正後の正規表現を出力とする修正サービスを提供するサーバ装置として実装される。この場合、修正サーバ装置は、Webサーバとして実装することとしてもよいし、アウトソーシングによって上記の修正処理に関するサービスを提供するクラウドとして実装することとしてもかまわない。
 図12は、修正プログラムを実行するコンピュータの一例を示す図である。コンピュータ1000は、例えば、メモリ1010、CPU1020を有する。また、コンピュータ1000は、ハードディスクドライブインタフェース1030、ディスクドライブインタフェース1040、シリアルポートインタフェース1050、ビデオアダプタ1060、ネットワークインタフェース1070を有する。これらの各部は、バス1080によって接続される。
 メモリ1010は、ROM(Read Only Memory)1011及びRAM(Random Access Memory)1012を含む。ROM1011は、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース1030は、ハードディスクドライブ1090に接続される。ディスクドライブインタフェース1040は、ディスクドライブ1100に接続される。例えば磁気ディスクや光ディスク等の着脱可能な記憶媒体が、ディスクドライブ1100に挿入される。シリアルポートインタフェース1050は、例えばマウス1110、キーボード1120に接続される。ビデオアダプタ1060は、例えばディスプレイ1130に接続される。
 ハードディスクドライブ1090は、例えば、OS1091、アプリケーションプログラム1092、プログラムモジュール1093、プログラムデータ1094を記憶する。すなわち、修正装置10の各処理を規定するプログラムは、コンピュータにより実行可能なコードが記述されたプログラムモジュール1093として実装される。プログラムモジュール1093は、例えばハードディスクドライブ1090に記憶される。例えば、修正装置10における機能構成と同様の処理を実行するためのプログラムモジュール1093が、ハードディスクドライブ1090に記憶される。なお、ハードディスクドライブ1090は、SSD(Solid State Drive)により代替されてもよい。
 また、上述した実施形態の処理で用いられる設定データは、プログラムデータ1094として、例えばメモリ1010やハードディスクドライブ1090に記憶される。そして、CPU1020は、メモリ1010やハードディスクドライブ1090に記憶されたプログラムモジュール1093やプログラムデータ1094を必要に応じてRAM1012に読み出して、上述した実施形態の処理を実行する。
 なお、プログラムモジュール1093やプログラムデータ1094は、ハードディスクドライブ1090に記憶される場合に限らず、例えば着脱可能な記憶媒体に記憶され、ディスクドライブ1100等を介してCPU1020によって読み出されてもよい。あるいは、プログラムモジュール1093及びプログラムデータ1094は、ネットワーク(LAN(Local Area Network)、WAN(Wide Area Network)等)を介して接続された他のコンピュータに記憶されてもよい。そして、プログラムモジュール1093及びプログラムデータ1094は、他のコンピュータから、ネットワークインタフェース1070を介してCPU1020によって読み出されてもよい。
 10 修正装置
 11 インタフェース部
 12 記憶部
 13 制御部
 121 置換候補構文情報
 131 抽出部
 132 判定部
 133 生成部
 134 合成部

Claims (6)

  1.  ソースコードから第1の正規表現を抽出する抽出部と、
     前記第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する判定部と、
     前記第1の正規表現を基に、前記条件を満たさない第2の正規表現を合成する合成部と、
     を有することを特徴とする修正装置。
  2.  前記抽出部は、前記ソースコードを構文解析木に変換し、前記構文解析木から抽出された変数を基に復元した正規表現を前記第1の正規表現として抽出することを特徴とする請求項1に記載の修正装置。
  3.  第1の正規表現によって受理される文字列の集合である第1の集合、及び、前記第1の正規表現によって拒否される文字列の集合である第2の集合を生成する生成部をさらに有し、
     前記合成部は、前記第1の正規表現における範囲文字を所定の構文に置換した正規表現であって、前記第1の集合の文字列を受理し、かつ前記第2の集合の文字列を拒否するような正規表現である第2の正規表現を合成することを特徴とする請求項1に記載の修正装置。
  4.  前記生成部は、前記第1の正規表現を非決定性有限オートマトンに変換し、前記非決定性有限オートマトン上のパスのうち、受理状態に到達するパスにより得られた文字列の集合を前記第1の集合として生成し、前記非決定性有限オートマトン上のパスのうち、受理状態に到達しないパスにより得られた文字列の集合を前記第2の集合として生成することを特徴とする請求項3に記載の修正装置。
  5.  修正装置によって実行される修正方法であって、
     ソースコードから第1の正規表現を抽出する抽出工程と、
     前記第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する判定工程と、
     前記第1の正規表現を基に、前記条件を満たさない第2の正規表現を合成する合成工程と、
     を含むことを特徴とする修正方法。
  6.  ソースコードから第1の正規表現を抽出する抽出ステップと、
     前記第1の正規表現が、ReDoSに対して脆弱であることを示す条件を満たすか否かを判定する判定ステップと、
     前記第1の正規表現を基に、前記条件を満たさない第2の正規表現を合成する合成ステップと、
     をコンピュータに実行させることを特徴とする修正プログラム。
PCT/JP2022/022968 2022-06-07 2022-06-07 修正装置、修正方法及び修正プログラム WO2023238239A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/022968 WO2023238239A1 (ja) 2022-06-07 2022-06-07 修正装置、修正方法及び修正プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/022968 WO2023238239A1 (ja) 2022-06-07 2022-06-07 修正装置、修正方法及び修正プログラム

Publications (1)

Publication Number Publication Date
WO2023238239A1 true WO2023238239A1 (ja) 2023-12-14

Family

ID=89118095

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/022968 WO2023238239A1 (ja) 2022-06-07 2022-06-07 修正装置、修正方法及び修正プログラム

Country Status (1)

Country Link
WO (1) WO2023238239A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052625A (ja) * 2005-08-18 2007-03-01 Hitachi Software Eng Co Ltd ソースコード脆弱性検査装置
US11200144B1 (en) * 2017-09-05 2021-12-14 Amazon Technologies, Inc. Refinement of static analysis of program code
WO2022113308A1 (ja) * 2020-11-27 2022-06-02 日本電信電話株式会社 修正装置、修正方法及び修正プログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007052625A (ja) * 2005-08-18 2007-03-01 Hitachi Software Eng Co Ltd ソースコード脆弱性検査装置
US11200144B1 (en) * 2017-09-05 2021-12-14 Amazon Technologies, Inc. Refinement of static analysis of program code
WO2022113308A1 (ja) * 2020-11-27 2022-06-02 日本電信電話株式会社 修正装置、修正方法及び修正プログラム

Similar Documents

Publication Publication Date Title
US10044750B2 (en) Code labeling based on tokenized code samples
US9305116B2 (en) Dual DFA decomposition for large scale regular expression matching
CN108140091B (zh) 漏洞发现装置、漏洞发现方法以及存储介质
US8843912B2 (en) Optimization of an application to reduce local memory usage
WO2016201819A1 (zh) 检测恶意文件的方法和装置
KR102006245B1 (ko) 바이너리 파일에 기초하여 오픈소스 소프트웨어 패키지를 식별하는 방법 및 시스템
CN107615240B (zh) 用于分析二进制文件的基于生物序列的方案
WO2022113308A1 (ja) 修正装置、修正方法及び修正プログラム
JPWO2017217163A1 (ja) アクセス分類装置、アクセス分類方法及びアクセス分類プログラム
US20160196427A1 (en) System and Method for Detecting Branch Oriented Programming Anomalies
US11916937B2 (en) System and method for information gain for malware detection
JP7409197B2 (ja) ソフトウェアプログラムにおける静的分析違反の修復パターンの精緻化
CN116868193A (zh) 固件组件标识和漏洞评估
WO2023238239A1 (ja) 修正装置、修正方法及び修正プログラム
US20080222149A1 (en) Collation Regression Testing
WO2023238240A1 (ja) 検証装置、検証方法及び検証プログラム
CN112711424A (zh) 应用程序的风险问题确定方法、装置及存储介质
CN113688240B (zh) 威胁要素提取方法、装置、设备及存储介质
US11947907B2 (en) Analysis device, analysis method, and analysis program
JP7231664B2 (ja) 脆弱性特徴の取得方法、装置及び電子機器
CN108664792A (zh) 一种Android恶意软件的溯源方法
US11989326B2 (en) Programmable feature extractor with anonymization
WO2023238259A1 (ja) 修正装置、修正方法及び修正プログラム
JP7315023B2 (ja) ルール生成装置およびルール生成プログラム
JP6984760B2 (ja) 変換装置及び変換プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22945747

Country of ref document: EP

Kind code of ref document: A1