CN113486357A - Intelligent contract security detection method based on static analysis and deep learning - Google Patents
Intelligent contract security detection method based on static analysis and deep learning Download PDFInfo
- Publication number
- CN113486357A CN113486357A CN202110766768.XA CN202110766768A CN113486357A CN 113486357 A CN113486357 A CN 113486357A CN 202110766768 A CN202110766768 A CN 202110766768A CN 113486357 A CN113486357 A CN 113486357A
- Authority
- CN
- China
- Prior art keywords
- matrix
- abstract
- intelligent contract
- source program
- deep learning
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 58
- 238000004458 analytical method Methods 0.000 title claims abstract description 52
- 230000003068 static effect Effects 0.000 title claims abstract description 41
- 238000013135 deep learning Methods 0.000 title claims abstract description 29
- 238000013136 deep learning model Methods 0.000 claims abstract description 40
- 238000012549 training Methods 0.000 claims abstract description 34
- 238000000034 method Methods 0.000 claims abstract description 15
- 239000011159 matrix material Substances 0.000 claims description 97
- 230000006870 function Effects 0.000 claims description 50
- 230000014509 gene expression Effects 0.000 claims description 43
- 239000007787 solid Substances 0.000 claims description 22
- 238000012545 processing Methods 0.000 claims description 14
- 239000013598 vector Substances 0.000 claims description 12
- 230000007246 mechanism Effects 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000002372 labelling Methods 0.000 claims description 4
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 claims description 3
- 230000008676 import Effects 0.000 claims description 3
- 230000009191 jumping Effects 0.000 claims description 3
- 238000012886 linear function Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims description 3
- 101100379633 Xenopus laevis arg2-a gene Proteins 0.000 claims description 2
- 101150088826 arg1 gene Proteins 0.000 claims description 2
- 230000006399 behavior Effects 0.000 abstract description 4
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000009467 reduction Effects 0.000 description 3
- 238000012512 characterization method Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F21/577—Assessing vulnerabilities and evaluating computer system security
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/562—Static detection
- G06F21/563—Static detection by source code analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/425—Lexical analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Virology (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses an intelligent contract security detection method based on static analysis and deep learning, and relates to the technical field of block chain intelligent contract security. The method comprises the steps of carrying out static analysis on an intelligent contract security source program to obtain a graph structure of the intelligent contract security source program; abstract facts are extracted from the graph structure; according to the abstract fact of the relevance source program, a deep learning model for carrying out vulnerability classification on the relevance source program is built, and the deep learning model comprises the following steps: the device comprises an input module, an attention module, a residual error connecting module and an output module; constructing a training data set; training the deep learning model by using the training data set; and carrying out vulnerability detection on the input intelligent contract by using the trained deep learning model, and outputting a security detection result of the intelligent contract security source program. The method can comprehensively analyze the behavior of the intelligent contract security source program and improve the accuracy of security detection of the intelligent contract security source program.
Description
Technical Field
The invention relates to the technical field of block chain intelligent contract security, in particular to an intelligent contract security detection method based on static analysis and deep learning.
Background
A Smart Contract (Smart Contract) is a special protocol deployed in a blockchain. Buterin determines the applicability of decentralized computing outside of transactions and designs an Etherhouse blockchain that supports the execution of intelligent contracts. The smart contract contains code functions that include trading, decision making, and sending ethernet currency. Smart contracts have proven useful in many areas, including securities, communications, banking, medical, and the like. But the intelligent contract has the characteristic of transparency, namely, all participants can view the source code of the intelligent contract. And the intelligent contract has the characteristic that the intelligent contract can not be changed once deployed, so that the intelligent contract can not update software in time after finding a bug, and the loss can be reduced only by means of transaction suspension or bifurcation and the like. If the security detection is not carried out on the intelligent contract, the intelligent contract cannot be repaired in time, so that the normal use of the function of the intelligent contract is influenced, and even the benefit of the intelligent contract user can be damaged to cause serious consequences. Such as DAO attack events: the anonymous hacker uses the reentrant vulnerability of the intelligent contract to cheat 360 ten thousand Ethernet coins; parity cracking events: the deliberate breaker finds the time stamp loophole in the intelligent contract code library, and destroys the code library by utilizing the problem of inconsistent time stamps, thereby causing the loss of 1.5 hundred million dollars; malicious contract events: the five hackers maliciously release 34000 problematic intelligent contracts, which causes the ether house to be complicated, and generates abnormal chain reaction, thereby causing the ether currency with the value of 440 ten thousand dollars to be stolen. Under such severe security threat situation, currently, there is no good general means to detect the intelligent contract vulnerability, and the intelligent contract security assurance still mainly depends on the security technology level of the contract developer and the code audit based on expert experience. Therefore, an effective scheme for automatically detecting the security of the intelligent contract needs to be proposed urgently. The existing automatic safety detection has the following problems: 1. the intelligent contract code can not be analyzed in a full coverage mode, 2, the false alarm rate of security detection is high, and 3, only specific attacks are concerned, and other attacks are not easy to be detected.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides an intelligent contract security detection method based on static analysis and deep learning, aiming at solving the problem of intelligent contract security detection.
The technical scheme of the invention is as follows:
1. an intelligent contract security detection method based on static analysis and deep learning is characterized by comprising the following steps:
step 1: carrying out static analysis on the intelligent contract security source program to obtain a graph structure of the intelligent contract security source program; the static analysis comprises lexical analysis and syntactic analysis; the graph structure comprises an abstract syntax tree AST and a control flow graph CFG;
step 2: extracting abstract facts from the graph structure of the solid source program obtained in the step 1;
and step 3: according to the abstract fact of the relevance source program obtained in the step 2, a deep learning model for vulnerability classification of the relevance source program is built, and the deep learning model comprises the following steps: the device comprises an input module, an attention module, a residual error connecting module and an output module;
and 4, step 4: constructing a training data set of the deep learning model;
and 5: training the deep learning model by using the training data set;
step 6: and carrying out vulnerability detection on the input intelligent contract by using the trained deep learning model, and outputting a security detection result of the intelligent contract security source program.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the step 1 specifically includes the following steps:
step 1.1: preprocessing an intelligent contract security source program, and deleting all contents irrelevant to security detection of the security source program;
step 1.2: importing a source code file corresponding to the import statement into the preprocessed intelligent contract source program to obtain a complete source program of the intelligence;
step 1.3: for a complete solidity source program, converting the solidity source program into an abstract syntax tree by using an ANTLR analyzer;
step 1.4: and constructing a control flow graph CFG of the solid source program according to the abstract syntax tree.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the step 1.3 specifically includes the following steps:
step 1.3.1: performing lexical analysis on the complete solid source program by using an ANTLR analyzer, and labeling the attributes of words in the solid source program according to predefined word attribute categories to obtain a word sequence with word attribute labels corresponding to each program sentence;
step 1.3.2: performing syntactic analysis by using an ANTLR analyzer aiming at a word sequence corresponding to each program sentence generated by the lexical analysis, and determining a syntactic structure of each program sentence according to a predefined syntactic rule; the grammar structure comprises a contract structure, a function structure, a variable structure, an expression structure and a statement control flow structure;
step 1.3.3: the solidity source program is converted into an abstract syntax tree using an ANTLR parser according to the syntax structure of each program statement.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the word attribute categories include keyword < keyword >, visibility definer < qualifier >, variable data type < changeable type >, identifier < identifier >, operator > and constant < constant >.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the predefined grammar rules are as follows:
a)Contract::=”contract”<identifier>”{”[contractBlock]”}”;
b)ContractBlock::=[Function]|[Variable];
c)Function::=”function”<identifier>”(”[Variable]”)”<qualifier>[keyword][Return][”;”|Block];
d)Variable::=<variabletype><qualifier><identifier>[”=”Expression]”;”;
e)Expression::=Functioncall|<identifier>|Expression<operator>|Expression<operator>Expres sion|<identifier><operator><constant>;
f)Functioncall::=Expression”(”Variable”)”;
g)Block::=”{”Statement”}”;
h)Statement::=IfStatement|WhileStatment|ForStatement|Variable|Expression|Block|”break”|”continue”|Return;
i)IfStatement::=”if””(”Expression”)”Block[”else”Block];
j)WhileStatment::=”while””(”Expression”)”Block;
k)ForStatement::=”for””(”[Variable]”;”[Expression]”;”[Expression]”)”Block;
l)Return::=”return”[Expression]。
further, according to the intelligent contract security detection method based on static analysis and deep learning, the step 1.4 specifically includes the following steps:
step 1.4.1: constructing different basic blocks according to Block nodes in an abstract syntax tree AST by using program statements belonging to a statement control flow structure, recording statement numbers StmtId of each statement in each basic Block, and recording an incoming edge and an outgoing edge of each basic Block;
step 1.4.2: connecting different basic blocks, connecting two basic blocks when the outgoing edge of one basic block is equal to the incoming edge of another basic block, and recording the jumping condition of the basic block when the outgoing edge number of one basic block is more than 1;
step 1.4.3: and recording the number VarId of the variable and assignment operation Assign in the program statement by using a static single assignment form, namely, only performing one assignment operation on one variable, and modifying the name of the variable subjected to secondary assignment.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the abstract facts containing all control flow information, data information and function information of the intelligent contract are written in datalog language, and the abstract facts are structured as follows:
the predicate is defined according to a solid source program structure, and comprises a data type, a function type, an expression structure and a control flow structure; arg1, argn being other parameters related to the content of a specific solidity program statement.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the method for extracting the abstract fact from the graph structure of the relevance source program obtained in the step 1 comprises the following steps: and traversing the graph structure of the similarity source program, and extracting the abstract fact of the similarity source program according to the keyword matching.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the step 3 specifically includes the following steps:
step 3.1: building an input module: using a 0-1 coding matrix X to represent the abstract facts obtained in the step 2, respectively performing word embedding processing and position embedding processing on the abstract facts represented by the 0-1 coding matrix X, and splicing a matrix obtained after the word embedding processing and a matrix obtained after the position embedding processing to obtain an E matrix as the input of an attention module;
step 3.2: constructing an attention module, which specifically comprises the following steps:
step 3.2.1: obtaining a Q matrix, a K matrix and a V matrix of the abstract fact through three linear changes of the E matrix respectively, and obtaining an attention coefficient matrix A of the abstract fact according to a formula (4);
A=QKT (4)
the Q matrix is a Query matrix of the abstract facts and consists of Query vectors corresponding to each word of each abstract fact; the K matrix is a Key matrix of the abstract facts and consists of Key vectors corresponding to each word of each abstract fact; the V matrix is a Value matrix of the abstract facts and consists of Value vectors corresponding to each word of each abstract fact;
step 3.2.2: updating element values in the V matrix according to a formula (5) according to an attention coefficient matrix A of the abstract fact to obtain an updated V matrix V';
wherein dk represents the arithmetic sum of squares of the K matrix; the softmax function is an activation function;
step 3.2.3: adding a layer normalization mechanism into a matrix V 'of the attention module to enable elements in the matrix V' to be more standard so as to accelerate convergence and ensure the stability of feature distribution;
step 3.3: building a residual connecting module, wherein a matrix calculation formula of the residual connecting module is as follows:
Z=H(E)=E+F(E)=E+V″ (9)
wherein, the matrix E is the input of the attention module; v' is the output of the attention module; z is the output of the residual connecting module; f is a residual function, in the attention module, a mapping h (e) → Z is obtained through back propagation, and if there is no residual connection module, F (e) → 0;
step 3.4: the method comprises the following steps of building an output module to output vulnerability probability possibly existing in abstract facts, wherein the concrete steps of building the output module are as follows:
step 3.4.1: defining a vulnerability category output formula shown in a formula (10) for outputting abstract fact vulnerability category results of the intelligent contracts;
Pk=softmax(Linear(Z)) (10)
wherein, Linear represents a Linear function, and Linear transformation is carried out on the matrix Z for one time; pkProbability values for different vulnerability types;
step 3.4.2: and constructing a loss function of the deep learning model to enable the model to have vulnerability classification capability.
Further, according to the intelligent contract security detection method based on static analysis and deep learning, the loss function is a multi-class cross entropy loss function shown in formula (11):
Loss1=-∑k yklog(Pk) (11)
wherein, ykAnd k represents a tag of one-hot coding corresponding to the abstract fact, and represents a vulnerability category corresponding to the abstract fact.
Compared with the prior art, the invention has the following beneficial effects:
1. the behavior of the intelligent contract security source program can be comprehensively analyzed. The security detection of the intelligent contract firstly needs to comprehensively analyze the code behavior. In the method, the abstract syntax tree and the control flow graph of the intelligent contract solid source program are analyzed, and then the graph structure is abstracted into fact representation, so that the abstract fact can cover the code behavior more comprehensively, the semantic features in the program are effectively represented, and the support is provided for a later deep learning model machine.
2. The expandability of the security detection of the intelligent contract security source program is enhanced. The traditional security detection method is mainly based on predefined rules and only focuses on known security vulnerabilities. The deep learning model used by the method is not limited to specific security holes, and the model can be trained by supplementing the training set so as to detect various security holes and easily expand the security holes. In addition, on the aspect of security detection of unknown vulnerabilities, the method can have the detection capability of the vulnerabilities only by training the model again, and compared with the traditional security detection method, the method has good expandability on the detection of the security vulnerabilities.
3. The accuracy of security detection of the intelligent contract security source program is improved. In the method, the static analysis method and the deep learning method are combined to carry out security detection on the intelligent contract, the existing deep learning model is improved, the attention module is added to learn the key information in the abstract fact, the accuracy of security detection classification is effectively improved on the basis of improving vectorization representation of the abstract fact, and the missing report rate of security holes is also effectively reduced.
Drawings
FIG. 1 is a schematic flow chart of an intelligent contract security detection method based on static analysis and deep learning according to the present invention;
FIG. 2 is a diagram of an abstract syntax tree of example code in an embodiment of the present invention;
FIG. 3 is a diagram of a deep learning model architecture in an embodiment of the present invention;
FIG. 4 is a schematic diagram of an attention module according to an embodiment of the invention.
Detailed Description
The following detailed description of embodiments of the invention will be described in conjunction with the accompanying drawings. The following examples are intended to illustrate the invention only, but to limit the scope of the invention.
Fig. 1 is a schematic flow chart of an intelligent contract security detection method based on static analysis and deep learning according to the present invention, and the intelligent contract security detection method based on static analysis and deep learning includes the following steps:
step 1: carrying out static analysis on the intelligent contract security source program to obtain a graph structure of the intelligent contract security source program; the static analysis comprises lexical analysis and syntactic analysis; the Graph structure includes an Abstract Syntax Tree (AST) and a Control Flow Graph (CFG).
Step 1.1: preprocessing an intelligent contract security source program, and deleting all contents irrelevant to security detection of the security source program;
in a preferred embodiment, the preprocessing of the smart contract relevance source program includes deleting a single line of comments "//", multiple lines of comments "/" … "/", spaces "", a carriage return "\\ n", and all content not relevant to the security detection of the relevance source program.
Step 1.2: and importing a source code file corresponding to the import statement into the preprocessed intelligent contract source program to obtain the complete source program of the intelligence.
Step 1.3: for a complete solidity source, the solidity source is converted into an abstract syntax tree using an ANTLR parser.
Step 1.3.1: performing lexical analysis on the complete solid source program by using an ANTLR analyzer, and labeling the attributes of words in the solid source program according to predefined word attribute categories to obtain a word sequence with word attribute labels corresponding to each program sentence;
the word attribute categories include keyword < keyword >, visibility delimiter < qualifier >, variable data type < changeable type >, identifier < identifier >, operator > and constant.
Step 1.3.2: performing syntactic analysis by using an ANTLR analyzer aiming at a word sequence corresponding to each program sentence generated by the lexical analysis, and determining a syntactic structure of each program sentence according to a predefined syntactic rule; the grammar structure comprises a contract structure, a function structure, a variable structure, an expression structure and a statement control flow structure;
in a preferred embodiment, the grammar rules predefined using BNF (Backus-Naur Form, Backus-Van) are as follows, according to the linguistic properties:
m)Contract::=”contract”<identifier>”{”[contractBlock]”}”;
n)ContractBlock::=[Function]|[Variable];
o)Function::=”function”<identifier>”(”[Variable]”)”<qualifier>[keyword][Return][”;”|Block];
p)Variable::=<variabletype><qualifier><identifier>[”=”Expression]”;”;
q)Expression::=Functioncall|<identifier>|Expression<operator>|Expression<operator>Expression|<identifier><operator><constant>;
r)Functioncall::=Expression”(”Variable”)”;
s)Block::=”{”Statement”}”;
t)Statement::=IfStatement|WhileStatment|ForStatement|Variable|Expression|Block|”break”|”continue”|Return;
u)IfStatement::=”if””(”Expression”)”Block[”else”Block];
v)WhileStatment::=”while””(”Expression”)”Block;
w)ForStatement::=”for””(”[Variable]”;”[Expression]”;”[Expression]”)”Block;
x)Return::=”return”[Expression]。
step 1.3.3: converting the solid source program into an abstract syntax tree by using an ANTLR analyzer according to the syntax structure of each program statement;
for example, for the code shown below, it is converted into an abstract syntax tree as shown in fig. 2 using an ANTLR parser.
Step 1.4: constructing a control flow graph CFG of the solid source program according to the abstract syntax tree, which comprises the following concrete steps:
step 1.4.1: constructing different basic blocks according to Block nodes in an abstract syntax tree AST by using program statements belonging to a statement control flow structure, recording statement numbers StmtId of each statement in each basic Block, and recording an incoming edge and an outgoing edge of each basic Block;
step 1.4.2: connecting different basic blocks, connecting two basic blocks when the outgoing edge of one basic block is equal to the incoming edge of another basic block, and recording the jumping condition of the basic block when the outgoing edge number of one basic block is more than 1;
step 1.4.3: the number VarId of the variable in the program statement and the assignment operation Assign are recorded by using a static single assignment form (SSA form), that is, one variable only performs one assignment operation, and the variable name of the variable subjected to the secondary assignment is modified.
For example, for an assignment operation "x ═ 1; y is x + 1; x is y; "its static single assignment form is" x1 ═ 1; y ═ x1+ 1; x2 ═ y; "recording assignment operations for variables using a static single assignment form facilitates analysis of subsequent abstract facts.
Step 2: and (3) extracting an abstract fact from the graph structure of the solid source program obtained in the step (1), specifically, traversing the graph structure of the solid source program, and extracting the abstract fact of the solid source program according to keyword matching.
The abstract facts are written by using a datalog language and comprise all control flow information, data information and function information of the intelligent contracts, and the information is key characteristics related to security vulnerabilities;
in a preferred embodiment, the abstract facts are structured as follows:
where predicate is the name of the corresponding predicate defined according to the solidity structure, arg 1.
In the preferred embodiment, there are four predicate names, data type, function type, expression structure, and control flow structure. The specific predicate name definition and the parameter definition are as follows:
traversing all nodes of AST of the solid source program, defining a predicate name of the nodes as VarDecl for an operation node Variable of a data type, defining a predicate name of the nodes as FunDecl for an operation node Function of a Function type, and defining a predicate name of the nodes as FunCall for a Function call node Funcionall in an expression structure, wherein for the call of a special Function, the predicate names of the nodes include address-dependent functions call, delegatecall, send, transfer and error handling functions reverse, assert and requirer, and defining the predicate name as an original name; the parameters are the related statement number, the variable number and the parameters of all leaf nodes corresponding to the nodes.
Traversing a control flow graph of a solid source program, defining the predicate name of an assignment operation Assign between variables as VarAss, defining parameters as a corresponding statement number stmtId and a related variable number varId, defining the predicate name of a statement in the same basic Block as Block, defining parameters as a basic Block number Block Id and a statement number stmtId, and defining the predicate name of the statement as Block when a path exists between basic blocks and defining the predicate name as Block Path and the parameter as a corresponding basic Block number Block Id.
For example, the abstract facts extracted by traversing the graph structure generated by the example code in step 1.3.2 are as follows:
VarDecl(StmtId='S00',VarId='V00',variabletype='uint',identifier='storedData')
Block(BlockId='B00',StmtId='S00')
FunDecl(identifier='set',VarId='V01',qualifier='public')
VarDecl(VarId=′V01′,variabletype=′uint′,identifier=′x′)
Block(BlockId=′B01′,StmtId=′S01′)
VarAss(StmtId=′S01′,VarId=′V00′,VarId=′V01′)
and step 3: according to the abstract fact of the solubility source program obtained in the step 2, building a deep learning model for carrying out vulnerability classification on the solubility source program;
in a preferred embodiment, the structure design deep learning model based on the Transformer model, as shown in fig. 3, includes four modules: the device comprises an input module, an attention module, a residual error connecting module and an output module. The construction process of the deep learning model comprises the following steps:
step 3.1: building an input module: performing vectorization preprocessing on the abstract facts obtained in the step 2, representing the input abstract facts by using a 0-1 coding matrix X, and performing dimension reduction processing because the 0-1 coding matrix X is too sparse, namely performing word embedding processing and position embedding processing on the abstract facts represented by the 0-1 coding matrix X, wherein the matrix obtained after the dimension reduction processing is the input required by the attention module, and the specific steps are as follows:
step 3.1.1: performing word embedding processing on the abstract facts represented by the 0-1 coding matrix X according to formula (1) to obtain a word matrix X':
Xl*d′=tanh(Xl*v W1) (1)
wherein, W1Is a parameter matrix to be trained in the input module; l is the row number of the longest abstract fact in the abstract facts corresponding to different solid source programs; v is the vocabulary size of the abstract fact; d is the dimension of the term after dimension reduction.
Step 3.1.2: performing position embedding processing on abstract facts represented by a 0-1 coding matrix X;
in order to ensure that the deep learning model can better acquire the position information of the abstract facts, the input module introduces a position coding mechanism of the abstract facts, namely position embedding.
In the preferred embodiment, the position information of each statement in the abstract fact is represented by a matrix P, and the matrix P is subjected to an activation function according to formula (2) to obtain a position coding matrix P':
Pl*d′=tanh(Pl*d) (2)
the matrix P is initialized randomly before training, and a position coding matrix P' formed by position vectors corresponding to each position is obtained after training.
Step 3.1.3: for the abstract fact of an intelligent contract, the position coding matrix P 'and the word matrix X' are spliced according to the formula (3) to obtain an E matrix which is used as the input of the attention module.
Step 3.2: constructing an attention module, wherein a schematic diagram of the attention module is shown in FIG. 4;
the attention module is the core of the deep learning model. Through the attention mechanism of the module, attention coefficients among abstract fact words can be calculated, and the vector corresponding to each word of each abstract fact contains information of vectors corresponding to other words, so that key information in the abstract facts can be better acquired. The principle of the attention mechanism is that the attention coefficient between each word and other words in the abstract fact is obtained by matrix multiplication.
In a preferred embodiment, the specific steps of building the attention module are as follows:
step 3.2.1: calculating attention coefficients among the abstract fact words to obtain an attention coefficient matrix of the abstract facts;
the calculation of the attention coefficient in the preferred embodiment is similar to BERT, involving three matrices: q matrix, K matrix, and V matrix. The Q matrix is a Query matrix of the abstract facts and consists of Query vectors corresponding to each word of each abstract fact; the K matrix is a Key matrix of the abstract facts and is composed of Key vectors corresponding to each word of each abstract fact, and the V matrix is a Value matrix of the abstract facts and is composed of Value vectors corresponding to each word of each abstract fact. The three matrixes are randomly given values in an initial state, are respectively obtained by three linear changes of the matrix E, and have characterization significance after being trained.
An attention coefficient matrix of the abstract fact is obtained according to formula (4):
A=QKT (4)
step 3.2.2: updating element values in the V matrix according to the attention coefficient matrix A of the abstract fact to obtain an updated V matrix y';
in a preferred embodiment, after obtaining the attention coefficient matrix a, the element values in the V matrix are updated according to equation (5), and an updated V matrix V' can be obtained.
Where dk represents the arithmetic square sum of the K matrix, and the dimension enlarged by the square multiple after multiplication is reduced to the original size in formula (5), and a certain gradient update value jitter is reduced in the process of back propagation. Softmax is an activation function, and the significance of the activation function is that the characterization capability of a V' matrix is enhanced by adding nonlinear change.
Step 3.2.3: adding a layer normalization mechanism into a matrix V 'of the attention module to enable elements in the matrix V' to be more standard so as to accelerate convergence and ensure the stability of feature distribution;
the layer normalization mechanism takes the inputs of all dimensions of the matrix V' into account, calculates the average input value and input variance, and then transforms the inputs of each dimension using the same normalization operation. The formula of the mean of all elements of the V' matrix is as follows:
the variance formula for all elements of the V' matrix is as follows:
wherein n is(v)Is the number of elements in V,. mu.(v)Is taken as the mean value of the average value,is the variance, σ(v)Is the standard deviation. Each element V in the matrix ViNormalization is performed according to equation (8):
in the above formula, vi' for each element V in the matrix ViNormalized values.
Step 3.3: building a residual error connection module;
in the preferred embodiment, the vocabulary of the source input (abstract facts) of the deep learning model is too small, the attention module may capture the connection relationship between words excessively, and the residual connection module is added to overcome the problem to some extent.
In a preferred embodiment, the matrix calculation formula of the residual concatenation module is as follows:
Z=H(E)=E+F(E)=E+V″ (9)
wherein, the matrix E is the input of the attention module; v "is the output of the attention module and the addition of these two matrices results in the output Z of the residual concatenation module. F is the residual function, and in the attention module, a mapping h (e) → Z is obtained through back propagation, and if there is no residual connecting module, F (e) → 0.
Step 3.4: building an output module;
the output module is used for outputting the possible vulnerability probability of the abstract fact and maximizing the security vulnerability detection capability of the deep learning model according to the loss function.
In a preferred embodiment, the specific steps of constructing the output module are as follows:
step 3.4.1: and defining a vulnerability category output formula shown in the formula (10) for outputting an abstract fact vulnerability category result of the intelligent contract.
Pk=softmax(Linear(Z)) (10)
Wherein, Linear represents a Linear function, namely, a Linear transformation is carried out on the matrix Z, the softmax function is an activation function, PkProbability values for different vulnerability types.
Step 3.4.2: and (3) constructing a loss function of the deep learning model, wherein the model has vulnerability classification capability through the loss function, and the loss function is a multi-class cross entropy loss function shown in formula (11).
Loss1=-∑k yklog(Pk) (11)
Wherein, ykAnd k represents a tag of one-hot coding corresponding to the abstract fact, and represents a vulnerability category corresponding to the abstract fact.
And 4, step 4: constructing a training data set of a deep learning model;
vulnerability detection problems can be considered as multi-classification problems in machine learning. Because the classification problem belongs to supervised learning, data (relevance program) and tags for data (vulnerability type) are required. Therefore, the construction of the training data set of the deep learning model comprises the steps of acquiring data and labeling the data with label types.
In the preferred embodiment, a total of 1500 program files of the real-life smart contracts for the etherhouse are first collected. And then, according to the definition of the SWC Registry on the vulnerability of the intelligent contract, carrying out manual marking on the 1500 program files, and constructing a training data set of the deep learning model. The SWC Registry is an intelligent contract vulnerability annotation standard library which is mainstream at present. It is built by Etherhouse Security and developers in the Smart Contract Security organization. The vulnerability library provides Ethengfang intelligent contract security vulnerability classification, partial test cases and consequences caused by vulnerabilities. The number of holes in each category in the training dataset and the occupation ratio are shown in table 2.
TABLE 2 vulnerability Numbers and ratios
Vulnerability category | Number of | Ratio of occupation of |
Reentrant vulnerabilities | 1014 | 67.6% |
Timestamp dependency vulnerabilities | 715 | 46.7% |
Endless loop leak | 326 | 21.7% |
Without leak | 293 | 19.5% |
And 5: and training a deep learning model by utilizing the training data set.
In a preferred embodiment, the training of the deep learning model is divided into two steps, the first step being pre-training (pre-train) with the aim of rapidly dropping the value of the loss function of the deep learning model. The second step is fine-tuning training (Finetune Train) aiming at further improving the security detection capability of the deep learning model. The combined training mode of pre-training and fine-tuning training enables the deep learning model to have better robustness and expandability.
In a preferred embodiment, the Jupyter notewood platform with GPU resources is used for pre-training and fine-tuning training of the deep learning model: during pre-training, setting the Batch-size to be 16, setting the Epoch to be 80, selecting the optimizer to be Adam, and stopping the pre-training to start fine tuning training when the loss value is stably changed to be 1; during the fine tuning training, the Batch-size is set to 4, the Epoch is set to 20, the optimizer selects SGD, and the fine tuning training is stopped when the loss value changes steadily to 0.1. The deep learning model after pre-training and fine-tuning training has vulnerability classification capability for the intelligent contract.
Step 6: carrying out vulnerability detection on the input intelligent contract by using the trained deep learning model, and outputting a security detection result of the intelligent contract security source program;
and detecting the vulnerability of the intelligent contract by using the trained deep learning model, wherein the output result is the probability value of each vulnerability type, if the output probability value is more than or equal to 0.5, the vulnerability of the intelligent contract is considered to exist, and if the output probability value is less than 0.5, the vulnerability does not exist. The method can effectively and automatically detect the security of the intelligent contract.
It is to be understood that the above-described embodiments are only a few embodiments of the present invention, and not all embodiments. The above examples are only for explaining the present invention and do not constitute a limitation to the scope of protection of the present invention. All other embodiments, which can be derived by those skilled in the art from the above-described embodiments without any creative effort, namely all modifications, equivalents, improvements and the like made within the spirit and principle of the present application, fall within the protection scope of the present invention claimed.
Claims (10)
1. An intelligent contract security detection method based on static analysis and deep learning is characterized by comprising the following steps:
step 1: carrying out static analysis on the intelligent contract security source program to obtain a graph structure of the intelligent contract security source program; the static analysis comprises lexical analysis and syntactic analysis; the graph structure comprises an abstract syntax tree AST and a control flow graph CFG;
step 2: extracting abstract facts from the graph structure of the solid source program obtained in the step 1;
and step 3: according to the abstract fact of the relevance source program obtained in the step 2, a deep learning model for vulnerability classification of the relevance source program is built, and the deep learning model comprises the following steps: the device comprises an input module, an attention module, a residual error connecting module and an output module;
and 4, step 4: constructing a training data set of the deep learning model;
and 5: training the deep learning model by using the training data set;
step 6: and carrying out vulnerability detection on the input intelligent contract by using the trained deep learning model, and outputting a security detection result of the intelligent contract security source program.
2. The intelligent contract security detection method based on static analysis and deep learning according to claim 1, wherein the step 1 specifically comprises the following steps:
step 1.1: preprocessing an intelligent contract security source program, and deleting all contents irrelevant to security detection of the security source program;
step 1.2: importing a source code file corresponding to the import statement into the preprocessed intelligent contract source program to obtain a complete source program of the intelligence;
step 1.3: for a complete solidity source program, converting the solidity source program into an abstract syntax tree by using an ANTLR analyzer;
step 1.4: and constructing a control flow graph CFG of the solid source program according to the abstract syntax tree.
3. The intelligent contract security detection method based on static analysis and deep learning according to claim 2, wherein the step 1.3 specifically comprises the following steps:
step 1.3.1: performing lexical analysis on the complete solid source program by using an ANTLR analyzer, and labeling the attributes of words in the solid source program according to predefined word attribute categories to obtain a word sequence with word attribute labels corresponding to each program sentence;
step 1.3.2: performing syntactic analysis by using an ANTLR analyzer aiming at a word sequence corresponding to each program sentence generated by the lexical analysis, and determining a syntactic structure of each program sentence according to a predefined syntactic rule; the grammar structure comprises a contract structure, a function structure, a variable structure, an expression structure and a statement control flow structure;
step 1.3.3: the solidity source program is converted into an abstract syntax tree using an ANTLR parser according to the syntax structure of each program statement.
4. The intelligent contract security detection method based on static analysis and deep learning of claim 3, wherein the word attribute categories include keyword < keyword >, visibility definer < qualifier >, variable data type < variable > identifier < identifier >, operator < operator > and constant < constant >.
5. The intelligent contract security detection method based on static analysis and deep learning of claim 3, wherein the predefined grammar rules are as follows:
a)Contract::=”contract”<identifier>”{”[contractBlock]”}”;
b)ContractBlock::=[Function]|[Variable];
c)Function::=”function”<identifier>”(”[Variable]”)”<qualifier>[keyword][Return][”;”|Block];
d)Variable::=<variabletype><qualifier><identifier>[”=”Expression]”;”;
e)Expression::=Functioncall|<identifier>|Expression<operator>|Expression<operator>Expression|<identifier><operator><constant>;
f)Functioncall::=Expression”(”Variable”)”;
g)Block::=”{”Statement”}”;
h)Statement::=IfStatement|WhileStatment|ForStatement|Variable|Expression|Block|”break”|”continue”|Return;
i)IfStatement::=”if””(”Expression”)”Block[”else”Block];
j)WhileStatment::=”while””(”Expression”)”Block;
k)ForStatement::=”for””(”[Variable]”;”[Expression]”;”[Expression]”)”Block;
l)Return::=”return”[Expression]。
6. the intelligent contract security detection method based on static analysis and deep learning according to claim 2, wherein the step 1.4 specifically comprises the following steps:
step 1.4.1: constructing different basic blocks according to Block nodes in an abstract syntax tree AST by using program statements belonging to a statement control flow structure, recording statement numbers StmtId of each statement in each basic Block, and recording an incoming edge and an outgoing edge of each basic Block;
step 1.4.2: connecting different basic blocks, connecting two basic blocks when the outgoing edge of one basic block is equal to the incoming edge of another basic block, and recording the jumping condition of the basic block when the outgoing edge number of one basic block is more than 1;
step 1.4.3: and recording the number VarId of the variable and assignment operation Assign in the program statement by using a static single assignment form, namely, only performing one assignment operation on one variable, and modifying the name of the variable subjected to secondary assignment.
7. The intelligent contract security detection method based on static analysis and deep learning of claim 1, wherein the abstract facts contain all control flow information, data information and function information of the intelligent contract and are written by using datalog language, and the abstract facts have the following structural form:
the predicate is defined according to a solid source program structure, and comprises a data type, a function type, an expression structure and a control flow structure; arg1, argn being other parameters related to the content of a specific solidity program statement.
8. The intelligent contract security detection method based on static analysis and deep learning of claim 1 or 7, wherein the method for extracting abstract facts from the graph structure of the solid source program obtained in step 1 is as follows: and traversing the graph structure of the similarity source program, and extracting the abstract fact of the similarity source program according to the keyword matching.
9. The intelligent contract security detection method based on static analysis and deep learning according to claim 1, wherein the step 3 specifically comprises the following steps:
step 3.1: building an input module: using a 0-1 coding matrix X to represent the abstract facts obtained in the step 2, respectively performing word embedding processing and position embedding processing on the abstract facts represented by the 0-1 coding matrix X, and splicing a matrix obtained after the word embedding processing and a matrix obtained after the position embedding processing to obtain an E matrix as the input of an attention module;
step 3.2: constructing an attention module, which specifically comprises the following steps:
step 3.2.1: obtaining a Q matrix, a K matrix and a V matrix of the abstract fact through three linear changes of the E matrix respectively, and obtaining an attention coefficient matrix A of the abstract fact according to a formula (4);
A=QKT (4)
the Q matrix is a Query matrix of the abstract facts and consists of Query vectors corresponding to each word of each abstract fact; the K matrix is a Key matrix of the abstract facts and consists of Key vectors corresponding to each word of each abstract fact; the V matrix is a Value matrix of the abstract facts and consists of Value vectors corresponding to each word of each abstract fact;
step 3.2.2: updating element values in the V matrix according to a formula (5) according to an attention coefficient matrix A of the abstract fact to obtain an updated V matrix V';
wherein d iskExpressing the arithmetic square sum of the K matrix; the softmax function is an activation function;
step 3.2.3: adding a layer normalization mechanism into a matrix V 'of the attention module to enable elements in the matrix V' to be more standard so as to accelerate convergence and ensure the stability of feature distribution;
step 3.3: building a residual connecting module, wherein a matrix calculation formula of the residual connecting module is as follows:
Z=H(E)=E+F(E)=E+V″ (9)
wherein, the matrix E is the input of the attention module; v' is the output of the attention module; z is the output of the residual connecting module; f is a residual function, in the attention module, a mapping h (e) → Z is obtained through back propagation, and if there is no residual connection module, F (e) → 0;
step 3.4: the method comprises the following steps of building an output module to output vulnerability probability possibly existing in abstract facts, wherein the concrete steps of building the output module are as follows:
step 3.4.1: defining a vulnerability category output formula shown in a formula (10) for outputting abstract fact vulnerability category results of the intelligent contracts;
Pk=softmax(Linear(Z)) (10)
wherein, Linear represents a Linear function, and Linear transformation is carried out on the matrix Z for one time; pkProbability values for different vulnerability types;
step 3.4.2: and constructing a loss function of the deep learning model to enable the model to have vulnerability classification capability.
10. The intelligent contract security detection method based on static analysis and deep learning of claim 9, wherein the loss function is a multi-class cross-entropy loss function represented by equation (11):
Loss1=-∑kyklog(Pk) (11)
wherein, ykAnd k represents a tag of one-hot coding corresponding to the abstract fact, and represents a vulnerability category corresponding to the abstract fact.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110766768.XA CN113486357B (en) | 2021-07-07 | 2021-07-07 | Intelligent contract security detection method based on static analysis and deep learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110766768.XA CN113486357B (en) | 2021-07-07 | 2021-07-07 | Intelligent contract security detection method based on static analysis and deep learning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113486357A true CN113486357A (en) | 2021-10-08 |
CN113486357B CN113486357B (en) | 2024-02-13 |
Family
ID=77941656
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110766768.XA Active CN113486357B (en) | 2021-07-07 | 2021-07-07 | Intelligent contract security detection method based on static analysis and deep learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113486357B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114048464A (en) * | 2022-01-12 | 2022-02-15 | 北京大学 | Ether house intelligent contract security vulnerability detection method and system based on deep learning |
CN115017507A (en) * | 2022-07-14 | 2022-09-06 | 北京华云安信息技术有限公司 | Method, device, equipment and storage medium for detecting source code tampering |
CN115033896A (en) * | 2022-08-15 | 2022-09-09 | 鹏城实验室 | Method, device, system and medium for detecting Ethernet intelligent contract vulnerability |
CN115146282A (en) * | 2022-08-31 | 2022-10-04 | 中国科学院大学 | AST-based source code anomaly detection method and device |
CN115879868A (en) * | 2022-09-09 | 2023-03-31 | 南京审计大学 | Intelligent contract security audit method integrating expert system and deep learning |
CN117033164A (en) * | 2023-05-17 | 2023-11-10 | 烟台大学 | Intelligent contract security vulnerability detection method and system |
CN118171290A (en) * | 2024-05-14 | 2024-06-11 | 烟台大学 | Intelligent contract vulnerability detection method and system based on source code and byte code |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109933991A (en) * | 2019-03-20 | 2019-06-25 | 杭州拜思科技有限公司 | A kind of method, apparatus of intelligence contract Hole Detection |
CN110096439A (en) * | 2019-04-26 | 2019-08-06 | 河海大学 | A kind of method for generating test case towards solidity language |
CN110111218A (en) * | 2019-03-18 | 2019-08-09 | 东北大学 | A kind of software copyright managing and control system and method based on block chain |
KR20190105774A (en) * | 2018-03-06 | 2019-09-18 | 충남대학교산학협력단 | Method for improving safty of calling function in smart contracts |
US20190370799A1 (en) * | 2018-05-30 | 2019-12-05 | Investa Tech Consulting, Inc. | Application for creating real time smart contracts |
CN110659494A (en) * | 2019-09-27 | 2020-01-07 | 重庆邮电大学 | Extensible intelligent contract vulnerability detection method |
CN111753306A (en) * | 2020-05-29 | 2020-10-09 | 西安深信科创信息技术有限公司 | Intelligent contract vulnerability detection method and device, electronic equipment and storage medium |
CN111861465A (en) * | 2020-07-21 | 2020-10-30 | 国家计算机网络与信息安全管理中心 | Detection method and device based on intelligent contract, storage medium and electronic device |
US11036614B1 (en) * | 2020-08-12 | 2021-06-15 | Peking University | Data control-oriented smart contract static analysis method and system |
CN113360915A (en) * | 2021-06-09 | 2021-09-07 | 扬州大学 | Intelligent contract multi-vulnerability detection method and system based on source code graph representation learning |
-
2021
- 2021-07-07 CN CN202110766768.XA patent/CN113486357B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20190105774A (en) * | 2018-03-06 | 2019-09-18 | 충남대학교산학협력단 | Method for improving safty of calling function in smart contracts |
US20190370799A1 (en) * | 2018-05-30 | 2019-12-05 | Investa Tech Consulting, Inc. | Application for creating real time smart contracts |
CN110111218A (en) * | 2019-03-18 | 2019-08-09 | 东北大学 | A kind of software copyright managing and control system and method based on block chain |
CN109933991A (en) * | 2019-03-20 | 2019-06-25 | 杭州拜思科技有限公司 | A kind of method, apparatus of intelligence contract Hole Detection |
CN110096439A (en) * | 2019-04-26 | 2019-08-06 | 河海大学 | A kind of method for generating test case towards solidity language |
CN110659494A (en) * | 2019-09-27 | 2020-01-07 | 重庆邮电大学 | Extensible intelligent contract vulnerability detection method |
CN111753306A (en) * | 2020-05-29 | 2020-10-09 | 西安深信科创信息技术有限公司 | Intelligent contract vulnerability detection method and device, electronic equipment and storage medium |
CN111861465A (en) * | 2020-07-21 | 2020-10-30 | 国家计算机网络与信息安全管理中心 | Detection method and device based on intelligent contract, storage medium and electronic device |
US11036614B1 (en) * | 2020-08-12 | 2021-06-15 | Peking University | Data control-oriented smart contract static analysis method and system |
CN113360915A (en) * | 2021-06-09 | 2021-09-07 | 扬州大学 | Intelligent contract multi-vulnerability detection method and system based on source code graph representation learning |
Non-Patent Citations (9)
Title |
---|
MINGHANG ZHAO 等: "Deep Residual Shrinkage Networks for Fault Diagnosis", IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, vol. 16, no. 7, pages 4681 - 4690, XP011780648, DOI: 10.1109/TII.2019.2943898 * |
POUYAN MOMENI 等: "Machine Learning Model for Smart Contracts Security Analysis", 2019 17TH INTERNATIONAL CONFERENCE ON PRICAVY, SECURITY AND TRUST(PST) * |
REDNAXELAFX: "如何使用AST生成程序的控制流图(CFG)?)", Retrieved from the Internet <URL:网页公开:https://www.zhihu.com/question/27730062> * |
ZI JIAO 等: "RPVC: A Revocable Publicly Verifiable Computation Solution for Edge Computing", RPVC: A REVOCABLE PUBLICLY VERIFIABLE COMPUTATION SOLUTION FOR EDGE COMPUTING. SENSORS 2022, pages 1 - 20 * |
倪远东;张超;殷婷婷;: "智能合约安全漏洞研究综述", 信息安全学报, no. 03, pages 83 - 104 * |
赵淦森;谢智健;王欣明;何嘉浩;张成志;林成创;ZIHENG ZHOU;陈冰川;CHUNMING RONG;: "ContractGuard:面向以太坊区块链智能合约的入侵检测系统", 网络与信息安全学报, no. 02, pages 39 - 59 * |
赵芳煜: "基于以太坊智能合约的漏洞扫描器的设计与整合", 中国优秀硕士学位论文全文数据库 信息科技辑, pages 3 * |
陆申明;左志强;王林章;: "静态程序分析并行化研究进展", 软件学报, no. 05, pages 7 - 18 * |
韩松明;梁彬;黄建军;石文昌;: "DC-Hunter:一种基于字节码匹配的危险智能合约检测方案", 信息安全学报, no. 03, pages 105 - 117 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114048464A (en) * | 2022-01-12 | 2022-02-15 | 北京大学 | Ether house intelligent contract security vulnerability detection method and system based on deep learning |
CN114048464B (en) * | 2022-01-12 | 2022-03-15 | 北京大学 | Ether house intelligent contract security vulnerability detection method and system based on deep learning |
CN115017507A (en) * | 2022-07-14 | 2022-09-06 | 北京华云安信息技术有限公司 | Method, device, equipment and storage medium for detecting source code tampering |
CN115033896A (en) * | 2022-08-15 | 2022-09-09 | 鹏城实验室 | Method, device, system and medium for detecting Ethernet intelligent contract vulnerability |
CN115033896B (en) * | 2022-08-15 | 2022-11-08 | 鹏城实验室 | Method, device, system and medium for detecting Ethernet intelligent contract vulnerability |
CN115146282A (en) * | 2022-08-31 | 2022-10-04 | 中国科学院大学 | AST-based source code anomaly detection method and device |
CN115879868A (en) * | 2022-09-09 | 2023-03-31 | 南京审计大学 | Intelligent contract security audit method integrating expert system and deep learning |
CN115879868B (en) * | 2022-09-09 | 2023-07-21 | 南京审计大学 | Expert system and deep learning integrated intelligent contract security audit method |
CN117033164A (en) * | 2023-05-17 | 2023-11-10 | 烟台大学 | Intelligent contract security vulnerability detection method and system |
CN117033164B (en) * | 2023-05-17 | 2024-03-29 | 烟台大学 | Intelligent contract security vulnerability detection method and system |
CN118171290A (en) * | 2024-05-14 | 2024-06-11 | 烟台大学 | Intelligent contract vulnerability detection method and system based on source code and byte code |
Also Published As
Publication number | Publication date |
---|---|
CN113486357B (en) | 2024-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113486357B (en) | Intelligent contract security detection method based on static analysis and deep learning | |
CN110737899B (en) | Intelligent contract security vulnerability detection method based on machine learning | |
CN109697162B (en) | Software defect automatic detection method based on open source code library | |
CN111611586B (en) | Software vulnerability detection method and device based on graph convolution network | |
CN112035841B (en) | Intelligent contract vulnerability detection method based on expert rules and serialization modeling | |
CN110581864B (en) | Method and device for detecting SQL injection attack | |
US20240143644A1 (en) | Event detection | |
WO2005069881A2 (en) | Predictive selection of content transformation in predictive modeling systems | |
CN111160749A (en) | Method and device for evaluating information quality and fusing information | |
CN111866004B (en) | Security assessment method, apparatus, computer system, and medium | |
CN112784066B (en) | Knowledge graph-based information feedback method, device, terminal and storage medium | |
CN113127933B (en) | Intelligent contract Pompe fraudster detection method and system based on graph matching network | |
US20230075290A1 (en) | Method for linking a cve with at least one synthetic cpe | |
Althar et al. | [Retracted] Software Systems Security Vulnerabilities Management by Exploring the Capabilities of Language Models Using NLP | |
CN115292520B (en) | Knowledge graph construction method for multi-source mobile application | |
CN111881300A (en) | Third-party library dependency-oriented knowledge graph construction method and system | |
CN112699375A (en) | Block chain intelligent contract security vulnerability detection method based on network embedded similarity | |
CN112784279A (en) | Software product safety risk assessment method based on dependency library version information | |
CN112115326A (en) | Multi-label classification and vulnerability detection method for Ether house intelligent contracts | |
Danas | Security and Interpretability in Large Language Models | |
CN111723182B (en) | Key information extraction method and device for vulnerability text | |
US20220036200A1 (en) | Rules and machine learning to provide regulatory complied fraud detection systems | |
CN117725592A (en) | Intelligent contract vulnerability detection method based on directed graph annotation network | |
CN116702157B (en) | Intelligent contract vulnerability detection method based on neural network | |
CN110162558B (en) | Structured data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |