CN113435893B - Security detection method and device for intelligent contract - Google Patents

Security detection method and device for intelligent contract Download PDF

Info

Publication number
CN113435893B
CN113435893B CN202110749282.5A CN202110749282A CN113435893B CN 113435893 B CN113435893 B CN 113435893B CN 202110749282 A CN202110749282 A CN 202110749282A CN 113435893 B CN113435893 B CN 113435893B
Authority
CN
China
Prior art keywords
assignment
parameter
instruction
determining
intelligent contract
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.)
Active
Application number
CN202110749282.5A
Other languages
Chinese (zh)
Other versions
CN113435893A (en
Inventor
傅滢
王海军
邬萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110749282.5A priority Critical patent/CN113435893B/en
Publication of CN113435893A publication Critical patent/CN113435893A/en
Application granted granted Critical
Publication of CN113435893B publication Critical patent/CN113435893B/en
Priority to PCT/CN2022/103305 priority patent/WO2023274398A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The embodiment of the specification provides a security detection method and device for an intelligent contract. The method comprises the following steps: determining an inter-process control flow diagram corresponding to the intelligent contract; in an inter-process control flow diagram, determining a plurality of target parameters which are subjected to assignment operation by using external data and the operation frequency of the assignment operation of each target parameter, wherein the target parameters belong to world state parameters of a block chain, and the external data is input into an intelligent contract from the outside; and determining whether the intelligent contract has safety risks or not according to the respective corresponding operation frequency of the target parameters.

Description

Security detection method and device for intelligent contract
Technical Field
One or more embodiments of the present disclosure relate to the field of block chain technologies, and in particular, to a method and an apparatus for security detection of an intelligent contract.
Background
A Smart contract (Smart contract) is a Commitment (commit) defined in digital form. The procedures of storage, reading and execution of the intelligent contracts can be tracked and cannot be tampered by a blockchain system for deploying the intelligent contracts. Both transaction parties registered in the blockchain system can deploy or call the intelligent contract, so that the purpose of exchanging resources or other services in a transparent and conflict-free manner is achieved.
The inventor researches to find that the intelligent contracts can have security risks. For example, the intelligent contracts themselves may be at risk of being subject to rearrangement attacks, and intruders may be at risk of rearranging the intelligent contracts to prevent the transactions initiated by users for invoking the intelligent contracts from achieving the expected effects.
A new technical solution is desired to detect whether security risks exist in the intelligent contracts themselves.
Disclosure of Invention
One or more embodiments of the present disclosure provide a security detection method and apparatus for an intelligent contract, which can more efficiently detect whether a security risk exists in the intelligent contract.
In a first aspect, a security detection method for an intelligent contract is provided, including: determining an inter-process control flow diagram corresponding to the intelligent contract; in the inter-process control flow diagram, determining a plurality of target parameters which are subjected to assignment operation by using external data and the operation frequency of the assignment operation of each target parameter, wherein the target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside; and determining whether the intelligent contract has safety risks or not according to the operation frequency corresponding to the target parameters.
In a possible implementation manner, determining whether the intelligent contract has a security risk according to the respective operation frequency corresponding to the target parameters specifically includes: when the operation frequency is larger than 1, the intelligent contract is determined to have security risk.
In a possible implementation manner, the intelligent contract includes a code segment and a data segment stored in a memory, the data segment includes the target parameters, and the code segment identifies the target parameters by a base address of the data segment in the memory and an address offset corresponding to the target parameters.
In one possible embodiment, the determining, in the inter-process control flow graph, a number of target parameters for a value assignment operation using external data includes: determining a plurality of first instruction sequences in the inter-process control flow graph, wherein the first instruction sequences are used for representing the propagation process of external data; determining a plurality of second instruction sequences in the inter-process control flow graph, wherein the second instruction sequences are used for representing the processes of the assignment of the world state parameters; and determining the target parameters according to the superposed assignment instructions between the first instruction sequences and the second instruction sequences.
In one possible embodiment, determining a number of first instruction sequences in the inter-process control flow graph includes: and in the inter-process control flow graph, adding a stain mark to a parameter corresponding to external data, tracking stains along the data flow direction, and classifying an instruction corresponding to the parameter added with the stain mark into the first instruction sequence.
In one possible embodiment, determining a number of second sequences of instructions in the inter-process control flow graph includes: determining world state parameters in the inter-process control flow graph; and determining an assignment instruction for assigning the world state parameters in the interprocess control flow graph, and classifying the assignment instruction into the second instruction sequence.
In one possible embodiment, determining world state parameters in the inter-process control flow graph includes: determining a plurality of function call instructions for calling a predetermined function in the inter-process control flow graph; and determining the parameter which is requested to be updated by the function call instruction as a world state parameter.
In a possible implementation manner, determining the target parameters according to the assignment instructions overlapped among the first instruction sequences and the second instruction sequences includes: and taking the world state parameter pointed by the overlapped assignment instruction as the target parameter.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process is used for indicating that assignment is not performed by using the external data. Determining whether the intelligent contract has a safety risk according to the respective operation frequency of the target parameters, specifically comprising: determining whether a first parameter exists in the target parameters, wherein the operation frequency corresponding to the first parameter is greater than 1, and the assignment process of the first parameter comprises a first class assignment process and a second class assignment process; if so, it is determined that the intelligent contract is at a security risk.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates direct assignment by using external data, the second type of assignment process indicates assignment by using an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates assignment not by using the external data. Determining whether the intelligent contract has a security risk according to the respective corresponding operation frequency of the target parameters, specifically comprising: determining whether a second parameter exists in the target parameters, wherein the operating frequency corresponding to the second parameter is greater than 1, the assignment processes of the second parameter include a first class assignment process and a second class assignment process, and the first class assignment process and the second class assignment process of the second parameter correspond to different method functions in the inter-process control flow graph; if so, it is determined that the intelligent contract is at a security risk.
In one possible implementation, the intelligent contract is an intelligent contract to be deployed into a blockchain; and/or the security risk specifically comprises a risk of being subjected to a rearrangement attack.
In a second aspect, a security detection apparatus for a smart contract is provided, including: the analysis processing unit is configured to determine an inter-process control flow graph corresponding to the intelligent contract; the assignment detection unit is configured to determine a plurality of target parameters for performing assignment operation by using external data and operation frequency of the assignment operation performed by each of the plurality of target parameters in the inter-process control flow graph, wherein the plurality of target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside; and the risk determining unit is configured to determine whether the intelligent contract has a safety risk according to the operation frequency corresponding to each of the target parameters.
In one possible embodiment, the risk determination unit is configured to determine that the smart contract is at a security risk when there is an operating frequency greater than 1.
In a possible implementation manner, the intelligent contract includes a code segment and a data segment stored in a memory, the data segment includes the target parameters, and the code segment identifies the target parameters by a base address of the data segment in the memory and an address offset corresponding to the target parameters.
In a possible implementation, the assignment detection unit includes: a first determining subunit, configured to determine, in the inter-process control flow graph, a number of first instruction sequences, where the first instruction sequences are used to characterize a propagation process of external data; a second determining subunit, configured to determine, in the inter-process control flow graph, a number of second instruction sequences, where the second instruction sequences are used to characterize a process in which the world state parameters are assigned; and the assignment detection subunit is configured to determine the target parameters according to the assignment instructions which are overlapped between the first instruction sequences and the second instruction sequences.
In a possible implementation manner, the first determining subunit is configured to add a taint mark to a parameter corresponding to external data in the inter-process control flow graph, perform taint tracking along a data flow direction, and include an instruction corresponding to the parameter added with the taint mark into the first instruction sequence.
In one possible embodiment, the second determining subunit is configured to determine a world state parameter in the inter-process control flow graph; and determining an assignment instruction for assigning the world state parameters in the inter-process control flow graph, and classifying the assignment instruction into the second instruction sequence.
In a possible implementation manner, the second determining subunit is specifically configured to determine, in the inter-process control flow graph, a number of function call instructions for calling a predetermined function; and determining the parameter which is requested to be updated by the function call instruction as a world state parameter.
In a possible embodiment, the assignment detection subunit is specifically configured to use the world state parameter pointed to by the overlapped assignment instruction as the target parameter.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process is used for indicating that assignment is not performed by using the external data. The risk determination unit is specifically configured to determine whether a first parameter exists in the target parameters, wherein the operation frequency corresponding to the first parameter is greater than 1, and the process of assigning the first parameter includes a first-class assignment process and a second-class assignment process; if so, it is determined that the intelligent contract is at a security risk.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates that assignment is not performed by using the external data. The risk determining unit is specifically configured to determine whether a second parameter exists in the target parameters, wherein the operating frequency corresponding to the second parameter is greater than 1, the process of assigning the second parameter includes a first-class assignment process and a second-class assignment process, and the first-class assignment process and the second-class assignment process of the second parameter correspond to different method functions in the inter-process control flow graph; if so, it is determined that the intelligent contract is at a security risk.
In one possible implementation, the intelligent contract is an intelligent contract to be deployed into a blockchain; and/or the security risk specifically comprises a risk of being subjected to a rearrangement attack.
In a third aspect, there is provided a computer readable storage medium having stored thereon a computer program/instructions which, when executed in a computing device, the computing device performs the method according to any one of the first aspect.
In a fourth aspect, there is provided a computing device comprising a memory having stored therein a computer program/instructions, and a processor implementing the method according to any one of the first aspect when the processor executes the computer program/instructions.
By the method and the device provided in one or more embodiments of the specification, whether the intelligent contract has a safety risk or not can be determined quickly and efficiently by determining the inter-process control flow diagram corresponding to the intelligent contract, then determining the operation frequency corresponding to each of a plurality of target parameters which are subjected to assignment operation by using external data in the intelligent contract based on the inter-process control flow diagram, and further determining whether the intelligent contract has the safety risk or not based on the operation frequency corresponding to each of the plurality of target parameters.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a security detection method for an intelligent contract provided in an embodiment of the present specification;
FIG. 2 is a schematic diagram illustrating a process of determining a target parameter for a value assignment operation using external data according to an embodiment of the present disclosure;
FIG. 3 is an exemplary inter-process control flow diagram provided in an embodiment of the present specification;
fig. 4 is a schematic diagram of a security detection apparatus of an intelligent contract provided in an embodiment of the present specification.
Detailed Description
Various non-limiting embodiments provided by the present specification are described in detail below with reference to the attached drawing figures.
The inventor researches to find that the intelligent contracts can have security risks. For example, the intelligent contract itself may be at risk of being re-ordered, and an intruder may make a re-ordered attack on the intelligent contract to cause the transaction for invoking the intelligent contract to fail to achieve the expected effect. For another example, the intelligent contract itself allows the world state parameters to be assigned by using external data, and an intruder may maliciously modify the world state parameters by calling different method functions in the intelligent contract, so that the transaction for calling the intelligent contract cannot achieve the expected effect.
The inventor finds that after an inter-process control flow graph (ICFG) of an intelligent contract is determined, static analysis may be performed on the ICFG to obtain the operation frequency of performing assignment operation on a plurality of target parameters belonging to world state parameters of a block chain, respectively, by using external data input from the outside in the intelligent contract. The operation frequency corresponding to each of the target parameters can reflect the possibility of security risks in the intelligent contract itself to some extent, wherein the security risks include but are not limited to the risk of being attacked by rearrangement.
Correspondingly, in order to realize quick and efficient detection of whether the intelligent contract has a security risk, the embodiment of the specification provides a security detection method and device for the intelligent contract. As shown in fig. 1, the method may include at least: step 101, determining an inter-process control flow diagram corresponding to an intelligent contract; 103, in the inter-process control flow diagram, determining a plurality of target parameters for carrying out assignment operation by using external data and the operation frequency of the assignment operation of each target parameter, wherein the target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside; and 105, determining whether the intelligent contract has safety risks or not according to the operation frequency corresponding to each of the target parameters.
The intelligent contract in which security detection is performed may be an intelligent contract to be deployed to a blockchain, or may also be an intelligent contract already deployed to a blockchain. Since the smart contracts are not modifiable or difficult to modify after being deployed to the blockchain, security detection is preferably performed on the smart contracts to be deployed to the blockchain; therefore, under the condition that the intelligent contract is determined to have the safety risk, the intelligent contract can be quickly and efficiently modified by workers, and other safety problems caused by the fact that the intelligent contract with the safety risk is deployed to the block chain and the block chain is linked with other safety problems can be avoided.
The method steps in the embodiment shown in fig. 1 are described in detail below.
First, in step 101, an inter-process control flow graph corresponding to an intelligent contract is determined.
By disassembling the intelligent contract loaded into the memory, a Control Flow Graph (CFG) corresponding to each function in the intelligent contract is first constructed based on the disassembling result. The CFG is a directed graph with basic blocks as nodes, and a single basic block comprises a plurality of assembly instructions which need to be sequentially executed; the directed edge connecting two nodes in the CFG represents that control transfer exists between the two nodes, and the CFG is provided with a unique inlet node and a unique outlet node. And then determining a function call relation in the intelligent contract based on the disassembled result, and constructing the ICFG by utilizing the CFG corresponding to each function according to the function call relation. The ICFG is a directed graph consisting of a CFG, a plurality of Call edges and a plurality of Return edges which are respectively corresponding to each function in the intelligent contract; the Call edges point to an entry node in the CFG corresponding to the called function through a function calling instruction in the CFG corresponding to the calling function; return edges points to the next instruction of the function call instruction in the CFG corresponding to the calling function from the Ret instruction in the CFG corresponding to the called function. In other words, the ICFG to which the intelligent contract corresponds is composed of a plurality of assembler instructions that at least characterize the arrangement/execution order of assembler instructions corresponding to the same or different functions.
The CFG composed of assembly instructions does not usually directly include the assigned world state parameters, but represents the world state parameters by memory addresses or address pointers pointing to the memory addresses, and the assignment of the world state parameters is completed by writing data on the memory addresses. If it is required to ensure that all assignment operations for assigning the world state parameters by using external data are found based on the ICFG in the subsequent process, it is required to ensure that a single world state parameter has a fixed and unique memory address in the memory, that is, the memory address is required to be used as an identifier of the world state parameter. In view of the above needs, in some embodiments, for a detected smart contract loaded into a memory, the detected smart contract includes a code segment and a data segment stored in the memory, and the data segment includes, but is not limited to, all world state parameters related to the smart contract; for a single world state parameter, the code segment identifies the world state parameter by the base address of the data segment in the memory and the address offset corresponding to the world state parameter. Correspondingly, since the ICFG is obtained by substantially disassembling the code segments of the intelligent contract, the memory address or the address pointer pointing to the memory address identified by the base address and the offset in the ICFG can be used as the identifier of the corresponding world state parameter.
Next, in step 103, in the inter-process control flow graph, a plurality of target parameters for performing assignment operations using external data and operation frequencies of the plurality of target parameters for performing the assignment operations are determined, the plurality of target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside.
By analyzing the ICFG, the propagation process of the external data and the process of assigning the world state parameters can be found, and further, the target parameters of the assignment operation by using the external data are determined from all the world state parameters related to the intelligent contract based on the propagation process of the external data and the process of assigning the world state parameters. In a more specific example, referring to fig. 2, several target parameters for performing assignment operations using external data may be determined in the ICFG through steps 1031 to 1035 as follows.
And step 1031, determining a plurality of first instruction sequences in the inter-process control flow diagram, wherein the first instruction sequences are used for representing the propagation process of external data.
Adding a stain mark to a parameter corresponding to external data in an ICFG (integrated circuit grid array), and then tracking stains along a data flow direction, so that a plurality of instructions corresponding to the parameter added with the stain mark can be sequentially determined, and the sequentially determined instructions can form a first instruction sequence for representing the propagation process of the external data. Illustratively, referring to the ICFG illustrated and simplified in fig. 3, the CFGs corresponding to the method functions Function _ a and Int Add (x, y) in the smart contract are each composed of different instruction sequences, wherein the basic blocks composed of instructions in the CFGs are not illustrated, and the directional edges characterizing the control transfer are not illustrated; the direction of the straight line arrow indicates the order of arrangement/execution of instructions in the CFG, and the broken line arrow represents a Call edge or Return edge; furthermore, the instantiation parameters/parameter values of the parameter a and the parameter b corresponding to the external data are exemplarily expressed as "0 Ah (i.e. instantiation parameter/parameter value 10)" and "14 h (i.e. instantiation parameter/parameter value 20), and obviously other instantiation parameters/parameter values can be used in the actual business scenario. Then, after analyzing the ICFG to determine that the parameter a and the parameter b are parameters corresponding to external data, the parameter a and the parameter b can be marked, namely, the ptr [ a ] and ptr [ b ] in the "mov dword ptr [ a ], 0 Ah" and "mov dword ptr [ b ], 14 h" can be marked with stain, and then stain tracing is carried out along the data flow direction, and a first instruction sequence with the starting point of "mov dword ptr [ a ], 0 Ah" and the end point of "mov dword ptr [ c ], eax" is determined. It should be noted that in the first instruction sequence, the instruction sequence constituting the CFG corresponding to Int Add (x, y) is located between "call _ Add" and "Add esp, 8".
Step 1033, determining a plurality of second instruction sequences in the inter-process control flow graph, wherein the second instruction sequences are used for characterizing the process of the world state parameter assignment.
First, all world state parameters involved in the intelligent contract may be determined in the ICFG. In a more specific example, a number of function call instructions that call a predetermined function are first determined in the ICFG. The predetermined function may be used to update the world state parameters of the block chain in the non-volatile storage medium, for example, the predetermined function may write the assigned world state parameters into the non-volatile storage medium by itself or calling other method functions; or, the predetermined function may be a method function for implementing a predetermined service in the block link point, for example, the predetermined service implemented by the predetermined function is that when the predetermined function is called by the intelligent contract, the block link point can know that the intelligent contract has completed assigning a certain world state parameter, so that the block link point can write the assigned world state parameter into the nonvolatile storage medium according to the corresponding service logic. Then, for each determined function call instruction, searching upwards in the ICFG by taking the function call instruction as a starting point, determining a parameter which the function call instruction requests to be updated, and determining the parameter as a world state parameter. Illustratively, continuing with reference to fig. 3, a function call instruction "call _ Rt" to call a predetermined function "_ Rt" may first be determined in the ICFG, and then an upward search may be performed in the ICFG starting at "call _ Rt", determining that the parameter that the "call _ Rt" requests to update is a parameter c added to the function stack by "moveax, dword ptr [ c ]" and "push eax", and further determining the parameter c as a world state parameter, where the parameter c is identified in fig. 3 by an address pointer ptr [ c ].
Then, since the world state parameters are identified in the ICFG by the memory address or address pointer, for each determined world state parameter, all assignment instructions for assigning the world state parameter may be determined in the ICFG by the memory address or address pointer for identifying the world state parameter. Illustratively, with continued reference to FIG. 3, an assignment instruction "mov dword ptr [ c ], eax" for assigning a value to ptr [ c ] may be determined in the ICFG based on the determined address pointer ptr [ c ] identifying the world state parameter c.
Finally, for each determined world state parameter, all assignment instructions for assigning the world state parameter can be classified into different second instruction sequences respectively. Specifically, for each assignment instruction for assigning a single world state parameter, the assignment instruction may be searched upward in the ICFG as a starting point until a source of a parameter value directly or indirectly used by the assignment instruction is searched, and then one of the second instruction sequences for characterizing the process in which the world state parameter is assigned is determined. Illustratively, continuing with FIG. 3, when "mov dword ptr [ c ], eax" is determined for assigning a value to ptr [ c ], then an upward search may be performed in the ICFG starting from "mov dword ptr [ c ], eax" until parameters a and b indirectly used by "mov dword ptr [ c ], eax" are searched. The four searched instructions can be used as the sources of parameter values indirectly used by the 'mov dword ptr [ c ], eax'; alternatively, the four instructions described above are used to add the instantiation parameters ptr [ a ], ptr [ b ] to the function stack, but do not indicate how ptr [ a ] and ptr [ b ] are created in the ICFG, so the search up may continue in the ICFG until "mov dword ptr [ a ], 0 Ah" and "mov dword ptr [ b ], 14 h" are searched for creating ptr [ a ] and ptr [ b ] in the function stack, and then "mov dword ptr [ a ], 0 Ah" and "mov dword ptr [ b ], 14 h" are used as the source of parameter values indirectly used by "mov dword ptr [ c ], eax". Correspondingly, for an assignment instruction 'mov dword ptr [ c ], eax' for assigning the world state parameter ptr [ c ], a second instruction sequence with a starting point of 'mov eax, dword ptr [ b ]' or 'mov dword ptr [ a ], 0 Ah' and an end point of 'mov dword ptr [ c ], eax' can be determined from the ICFG, and the second instruction sequence can completely represent the process of assigning the world state parameter ptr [ c ].
It should be noted that, in the ICFG illustrated in fig. 3, 1 second instruction sequence for characterizing the procedure in which ptr [ c ] is assigned may be determined, but in an actual service scenario, a plurality of second instruction sequences for characterizing the procedure in which ptr [ c ] is assigned may be determined in the ICFG corresponding to the intelligent contract. Illustratively, it is assumed that the smart contract includes a method Function _ B in addition to the aforementioned method functions Function _ a and Int Add (x, y), wherein the Function _ B implements functions of directly assigning external data to the world state parameter c and updating the world state parameter c in the nonvolatile storage medium by calling a predetermined Function "_ Rt" to the block link point. Then, the ICFG corresponding to the smart contract may further include, based on the ICFG illustrated in fig. 3, a CFG corresponding to Function _ B, where the CFG corresponding to Function _ B also includes an assignment instruction for assigning a value to ptr [ c ]. Correspondingly, since the CFG corresponding to Function _ a and the CFG corresponding to Function _ B each include an assignment instruction for assigning ptr [ c ], 2 second instruction sequences for characterizing the process in which the world state parameter c is assigned can be determined from the ICFG.
Step 1035, determining the target parameters according to the assignment instructions overlapped among the first instruction sequences and the second instruction sequences.
It is easy to find out with reference to the foregoing example that the last instruction in the second instruction sequence is an assignment instruction for assigning a world state parameter, and the first instruction in the first instruction sequence is for creating or adding external data in the function stack. Therefore, when the last instruction in the second instruction sequence coincides with/is the same as the last instruction in the first instruction sequence, it indicates that external data may be directly or indirectly used in the second instruction sequence to assign the world state parameters, so that the parameter pointed by the coincident assignment instruction may be determined as the target parameter to be assigned using the external data, that is, the parameter to which the coincident assignment instruction requests assignment is determined as the target parameter to be assigned using the external data. In a more specific example, after determining all second instruction sequences used for characterizing the processes of assigning the world state parameters for each world state parameter related to the intelligent contract, for each second instruction sequence corresponding to the world state parameter, detecting whether a target instruction sequence exists in all the determined first instruction sequences, where a last instruction in the target instruction sequence is the same as a last instruction in the second instruction sequence; and if so, determining the world state parameter as a target parameter for carrying out assignment operation by utilizing external data. Correspondingly, the foregoing processing is performed on each second instruction sequence for characterizing the process of assigning the world state parameter, so that the cumulative number of times that the world state parameter is determined as the target parameter can be counted, where the cumulative number of times is the operation frequency of assigning the world state parameter by using external data.
Referring back to fig. 1, in step 105, it is determined whether the smart contract has a security risk according to the respective operation frequency of the target parameters.
In a possible implementation manner, when the operation frequency greater than 1 exists in the operation frequencies corresponding to the target parameters, it may be determined that the security risk exists in the intelligent contract.
In some embodiments, the process of assigning the world state parameters represented by the second instruction sequence may be further divided into a first-class assignment process, a second-class assignment process, or a third-class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates that assignment is not performed by using the external data. For a single world state parameter, when a plurality of second instruction sequences representing the process of assigning the world state parameter are determined, assignment types corresponding to the plurality of second instruction sequences can be determined, and then all assignment types corresponding to the world state parameter are counted. Correspondingly, in step 105, it can be specifically determined whether a first parameter exists in the plurality of target parameters, the operation frequency corresponding to the first parameter is greater than 1, and the process of assigning the first parameter simultaneously includes two assignment types, namely a first assignment process and a second assignment process, i.e., the assignment type corresponding to the first parameter simultaneously includes the first assignment process and the second assignment process; and if the first parameter exists in the target parameters, determining that the security risk exists in the intelligent contract. Therefore, whether the intelligent contract has the safety risk or not can be determined more accurately by comprehensively considering the operation frequency of the assignment operation of the world state parameters by using the external data and the assignment type of the process of assigning the world state parameters.
Illustratively, please continue to refer to fig. 3. And a second instruction sequence with the mov dword ptr [ a ], 0Ah as a starting point and the mov dword ptr [ c ], eax as an end point characterizes the process of assigning the world state parameter c. The second instruction sequence indicates that the external data corresponding to the parameter a and the parameter b are used for carrying out logic operation, and the world state parameter c is assigned according to an operation result obtained after the logic operation, so that the assignment type to which the second instruction sequence belongs can be determined to be a second class assignment process, that is, the assignment process of the world state parameter c includes the second class assignment process, or the assignment type corresponding to the world state parameter c includes the second class assignment process.
Continuing to assume that the smart contract further includes the method Function _ B in the foregoing example, based on the assignment instruction for assigning the world state parameter c in the CFG corresponding to the Function _ B, another second instruction sequence for characterizing a process in which the world state parameter c is assigned may be determined, where the second instruction sequence may determine that the assignment type to which the second instruction sequence belongs is the first type of assignment process because the world state parameter c is directly assigned by using external data, that is, it is determined that the assignment process for the world state parameter c includes the first type of assignment process, or it is determined that the assignment type for the world state parameter c includes the first type of assignment process.
It is assumed that a method Function _ C is further included in the smart contract, where the Function _ C implements functions of assigning a preset value to the world state parameter C and updating the world state parameter C in the non-volatile storage medium by calling a predetermined Function "_ Rt". The ICFG corresponding to the smart contract may include a CFG corresponding to Function _ C, and the CFG corresponding to Function _ C includes an assignment instruction for assigning ptr [ C ]. Correspondingly, based on the assignment instruction for assigning the world state parameter C in the CFG corresponding to the Function _ C, a second instruction sequence for characterizing a process in which the world state parameter C is assigned may be determined, where the second instruction sequence directly assigns the world state parameter C using a preset constant, and does not assign the world state parameter C using external data, so that it may be determined that the assignment type to which the second instruction sequence belongs is the third type assignment process, that is, it is determined that the assignment process of the world state parameter C includes the third type assignment process, or it is determined that the assignment type corresponding to the world state parameter C includes the third type assignment process.
In some embodiments, for a single world state parameter, when a plurality of second instruction sequences characterizing the process in which the world state parameter is assigned are determined, a method function corresponding to each of the plurality of second instruction sequences may also be determined, for example, a method function to which an assignment instruction for assigning the world state parameter in the single second instruction sequence belongs is determined as a function corresponding to the second instruction sequence. Correspondingly, in step 105, it may be specifically determined whether a second parameter exists in the plurality of target parameters, where the operation frequency corresponding to the second parameter is greater than 1, the process of assigning the second parameter includes a first-class assignment process and a second-class assignment process, and the first-class assignment process and the second-class assignment process included in the second parameter correspond to different method functions in the inter-process control flow graph; and if the second parameter exists in the target parameters, determining that the security risk exists in the intelligent contract. Therefore, whether the intelligent contract has the safety risk or not can be more accurately determined by comprehensively considering the operation frequency of the assignment operation of the world state parameters by using the external data, the assignment type to which the assignment process of the world state parameters belongs, and the method functions corresponding to the instruction sequences of different assignment types.
Illustratively, please continue to refer to fig. 3. Assume that the smart contract includes the aforementioned method functions Function _ a, Int Add (x, y), and method Function _ B. Then, the assignment type of the second instruction sequence determined based on the assignment instruction for assigning the world state parameter c in the CFG corresponding to the Function _ a is a second class assignment process, and the corresponding Function is the Function _ a, that is, the method Function corresponding to the second class assignment process included in the world state parameter c is the Function _ a; the second instruction sequence is determined based on an assignment instruction used for assigning the world state parameter c in the CFG corresponding to the Function _ B, the assignment type of the second instruction sequence is a first-class assignment process, and the Function corresponding to the second instruction sequence includes the Function _ B, that is, the Function corresponding to the first-class assignment process of the world state parameter c is the Function _ B. In this case, the world state parameter c is used as a target parameter, the frequency of the assignment operation performed by using the external data is 2, the assignment process includes a first-class assignment process and a second-class assignment process, and the method Function _ a corresponding to the first-class assignment process is different from the method Function _ B corresponding to the second-class assignment process, so that the world state parameter c is determined as a second state parameter, and it can be determined that the security risk exists in the intelligent contract.
It should be noted that the ICFG illustrated and simplified in fig. 3 is only used to assist in describing the technical solution provided in the embodiment of the present specification, and the function that needs to be implemented by a part of common instructions in fig. 3 is not described in detail in the specification, but this does not affect the correct understanding of the ICFG illustrated in fig. 3 by those skilled in the art. In an actual business scenario, the instructions implementing the same functions may have different expressions, and more or fewer instructions may implement the functions required by one or more of the instructions in fig. 3.
The security detection device for the intelligent contract is also provided in the embodiment of the present specification. As shown in fig. 4, the apparatus includes: the analysis processing unit 401 is configured to determine an inter-process control flow graph corresponding to the intelligent contract; an assignment detection unit 403, configured to determine, in the inter-process control flow graph, a plurality of target parameters for performing assignment operations using external data, and operation frequencies of the plurality of target parameters for performing the assignment operations, where the plurality of target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside; a risk determining unit 405 configured to determine whether the intelligent contract has a security risk according to the operation frequency corresponding to each of the target parameters.
In one possible embodiment, the risk determination unit 405 is configured to determine that the smart contract is at a security risk when there is an operation frequency greater than 1.
In a possible implementation manner, the intelligent contract includes a code segment and a data segment stored in a memory, the data segment includes the target parameters, and the code segment identifies the target parameters by a base address of the data segment in the memory and an address offset corresponding to the target parameters.
In a possible implementation, the assignment detection unit 403 includes: a first determining subunit, configured to determine, in the inter-process control flow graph, a number of first instruction sequences, where the first instruction sequences are used to characterize a propagation process of external data; a second determining subunit, configured to determine, in the inter-process control flow graph, a number of second instruction sequences, where the second instruction sequences are used to characterize a process in which the world state parameters are assigned; and the assignment detection subunit is configured to determine the target parameters according to the assignment instructions which are overlapped between the first instruction sequences and the second instruction sequences.
In a possible implementation manner, the first determining subunit is configured to add a taint mark to a parameter corresponding to external data in the inter-process control flow graph, perform taint tracking along a data flow direction, and include an instruction corresponding to the parameter added with the taint mark into the first instruction sequence.
In one possible embodiment, the second determining subunit is configured to determine a world state parameter in the inter-process control flow graph; and determining an assignment instruction for assigning the world state parameters in the inter-process control flow graph, and classifying the assignment instruction into the second instruction sequence.
In a possible implementation manner, the second determining subunit is specifically configured to determine, in the inter-process control flow graph, a number of function call instructions for calling a predetermined function; and determining the parameter which is requested to be updated by the function call instruction as a world state parameter.
In a possible embodiment, the assignment detection subunit is specifically configured to use the world state parameter pointed to by the overlapped assignment instruction as the target parameter.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process is used for indicating that assignment is not performed by using the external data. The risk determining unit 405 is specifically configured to determine whether a first parameter exists in the target parameters, where an operation frequency corresponding to the first parameter is greater than 1, and a process of assigning the first parameter includes a first-class assignment process and a second-class assignment process; if so, it is determined that the intelligent contract is at a security risk.
In a possible implementation manner, the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates that assignment is not performed by using the external data. The risk determining unit 405 is specifically configured to determine whether a second parameter exists in the target parameters, where an operation frequency corresponding to the second parameter is greater than 1, a process of assigning the second parameter includes a first-class assignment process and a second-class assignment process, and the first-class assignment process and the second-class assignment process of the second parameter correspond to different method functions in the inter-process control flow graph; if so, it is determined that the intelligent contract is at a security risk.
In one possible implementation, the intelligent contract is an intelligent contract to be deployed into a blockchain; and/or the security risk specifically comprises a risk of being subjected to a rearrangement attack.
Those skilled in the art will recognize that in one or more of the examples described above, the functions described in this specification can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, a computer program corresponding to these functions may be stored in a computer-readable medium or transmitted as one or more instructions/codes on the computer-readable medium, so that when the computer program corresponding to these functions is executed by a computer, the method described in any one of the embodiments of the present specification is implemented by the computer.
Also provided in an embodiment of the present specification is a computer-readable storage medium, on which a computer program/instruction is stored, and when the computer program/instruction is executed in a computing device, the computing device executes the security detection method for an intelligent contract provided in any one of the embodiments of the present specification.
The embodiment of the present specification further provides a computing device, which includes a memory and a processor, where the memory stores a computer program/instruction, and when the processor executes the computer program/instruction, the method for detecting security of an intelligent contract provided in any one embodiment of the present specification is implemented.
The embodiments in the present description are described in a progressive manner, and the same and similar parts in the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.

Claims (24)

1. A security detection method of an intelligent contract comprises the following steps:
determining an inter-process control flow diagram corresponding to the intelligent contract;
in the inter-process control flow diagram, determining a plurality of target parameters which are subjected to assignment operation by using external data and the operation frequency of the assignment operation of each target parameter, wherein the target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside;
and determining whether the intelligent contract has safety risks or not according to the operation frequency corresponding to the target parameters.
2. The method according to claim 1, wherein determining whether the smart contract has a security risk according to the respective operation frequency corresponding to the target parameters specifically comprises: when the operation frequency is larger than 1, the intelligent contract is determined to have security risk.
3. The method of claim 1, wherein the smart contract comprises a code segment and a data segment stored in a memory, the data segment comprises the target parameters, and the code segment identifies the target parameters by a base address of the data segment in the memory and an address offset corresponding to the target parameters.
4. The method of claim 1, wherein determining, in the inter-process control flow graph, a number of target parameters for a valuation operation using external data comprises:
determining a plurality of first instruction sequences in the inter-process control flow graph, wherein the first instruction sequences are used for representing the propagation process of external data;
determining a plurality of second instruction sequences in the inter-process control flow graph, wherein the second instruction sequences are used for representing the processes of the assignment of the world state parameters;
and determining the target parameters according to the superposed assignment instructions between the first instruction sequences and the second instruction sequences.
5. The method of claim 4, wherein determining a number of first instruction sequences in the inter-process control flow graph comprises: and in the inter-process control flow graph, adding a stain mark to a parameter corresponding to external data, tracking stains along the data flow direction, and classifying an instruction corresponding to the parameter added with the stain mark into the first instruction sequence.
6. The method of claim 4, wherein determining a number of second sequences of instructions in the inter-process control flow graph comprises: determining world state parameters in the inter-process control flow graph; and determining an assignment instruction for assigning the world state parameters in the inter-process control flow graph, and classifying the assignment instruction into the second instruction sequence.
7. The method of claim 6, wherein determining world state parameters in the inter-process control flow graph comprises: determining a plurality of function call instructions for calling a predetermined function in the inter-process control flow graph; and determining the parameter which is requested to be updated by the function call instruction as a world state parameter.
8. The method of claim 4, wherein determining the number of target parameters based on the coincident evaluation instructions between the number of first instruction sequences and the number of second instruction sequences comprises: and taking the world state parameter pointed by the overlapped assignment instruction as the target parameter.
9. The method according to claim 4, wherein the processes in which the world state parameters characterized by the single second instruction sequence are assigned belong to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process is used for indicating that assignment is not performed by using the external data;
determining whether the intelligent contract has a security risk according to the respective corresponding operation frequency of the target parameters, specifically comprising:
determining whether a first parameter exists in the target parameters, wherein the operation frequency corresponding to the first parameter is greater than 1, and the assignment process of the first parameter comprises a first class assignment process and a second class assignment process;
if so, it is determined that the intelligent contract is at a security risk.
10. The method according to claim 4, wherein the process in which the world state parameters characterized by the single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates that assignment is not performed by using the external data;
determining whether the intelligent contract has a security risk according to the respective corresponding operation frequency of the target parameters, specifically comprising:
determining whether a second parameter exists in the target parameters, wherein the operating frequency corresponding to the second parameter is greater than 1, the assignment process of the second parameter comprises a first class assignment process and a second class assignment process, and the first class assignment process and the second class assignment process of the second parameter correspond to different method functions in the inter-process control flow graph;
if so, it is determined that the intelligent contract is at a security risk.
11. The method of any of claims 1-10, wherein the intelligent contract is an intelligent contract to be deployed into a blockchain; and/or the security risk specifically comprises a risk of being subjected to a rearrangement attack.
12. A security detection apparatus for smart contracts, comprising:
the analysis processing unit is configured to determine an inter-process control flow graph corresponding to the intelligent contract;
the assignment detection unit is configured to determine a plurality of target parameters for performing assignment operation by using external data and operation frequency of the assignment operation performed by each of the plurality of target parameters in the inter-process control flow graph, wherein the plurality of target parameters belong to world state parameters of a block chain, and the external data is input into the intelligent contract from the outside;
and the risk determining unit is configured to determine whether the intelligent contract has a safety risk according to the operation frequency corresponding to each of the target parameters.
13. The apparatus of claim 12, wherein the risk determination unit is configured to determine that the smart contract is at security risk when there is an operating frequency greater than 1.
14. The apparatus of claim 12 wherein the intelligent contract comprises a code section and a data section stored in a memory, the data section comprising the plurality of target parameters, the code section identifying the target parameters by a base address of the data section in the memory and an address offset corresponding to the target parameters.
15. The apparatus of claim 12, wherein the assignment detection unit comprises:
a first determining subunit, configured to determine, in the inter-process control flow graph, a number of first instruction sequences, where the first instruction sequences are used to characterize a propagation process of external data;
a second determining subunit, configured to determine, in the inter-process control flow graph, a number of second instruction sequences, where the second instruction sequences are used to characterize a process in which the world state parameters are assigned;
and the assignment detection subunit is configured to determine the target parameters according to the assignment instructions which are overlapped between the first instruction sequences and the second instruction sequences.
16. The apparatus of claim 15, wherein the first determining subunit is configured to add a dirty flag to a parameter corresponding to external data in the inter-process control flow graph, perform dirty tracking along a data flow direction, and include an instruction corresponding to the parameter with the dirty flag in the first instruction sequence.
17. The apparatus of claim 15, wherein the second determining subunit is configured to determine a world state parameter in the inter-process control flow graph; and determining an assignment instruction for assigning the world state parameters in the inter-process control flow graph, and classifying the assignment instruction into the second instruction sequence.
18. The apparatus according to claim 17, wherein the second determining subunit is specifically configured to determine, in the inter-process control flow graph, a number of function call instructions to call a predetermined function; and determining the parameter which is requested to be updated by the function call instruction as a world state parameter.
19. The apparatus according to claim 15, wherein the assignment detection subunit is configured to use, as the target parameter, a world state parameter to which the coincident assignment instruction points.
20. The apparatus according to claim 15, wherein the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates direct assignment by using external data, the second type of assignment process indicates assignment by using an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process is used for indicating that assignment is not performed by using the external data;
the risk determination unit is specifically configured to determine whether a first parameter exists in the target parameters, wherein the operation frequency corresponding to the first parameter is greater than 1, and the process of assigning the first parameter includes a first-class assignment process and a second-class assignment process; if so, it is determined that the intelligent contract is at a security risk.
21. The apparatus according to claim 15, wherein the process in which the world state parameters characterized by a single second instruction sequence are assigned belongs to a first class assignment process, a second class assignment process or a third class assignment process; the first type of assignment process indicates that direct assignment is performed by using external data, the second type of assignment process indicates that assignment is performed on an operation result obtained after logical operation is performed by using the external data, and the third type of assignment process indicates that assignment is not performed by using the external data;
the risk determining unit is specifically configured to determine whether a second parameter exists in the target parameters, wherein the operating frequency corresponding to the second parameter is greater than 1, the process of assigning the second parameter includes a first-class assignment process and a second-class assignment process, and the first-class assignment process and the second-class assignment process of the second parameter correspond to different method functions in the inter-process control flow graph; if so, it is determined that the intelligent contract is at a security risk.
22. The apparatus of any of claims 12-21, wherein the intelligent contract is an intelligent contract to be deployed into a blockchain; and/or the security risk specifically comprises a risk of being subjected to a rearrangement attack.
23. A computer-readable storage medium having stored thereon a computer program which, when executed in a computing device, performs the method of any of claims 1-11.
24. A computing device comprising a memory having stored therein a computer program and a processor that, when executing the computer program, implements the method of any of claims 1-11.
CN202110749282.5A 2021-07-01 2021-07-01 Security detection method and device for intelligent contract Active CN113435893B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110749282.5A CN113435893B (en) 2021-07-01 2021-07-01 Security detection method and device for intelligent contract
PCT/CN2022/103305 WO2023274398A1 (en) 2021-07-01 2022-07-01 Security detection method and apparatus for smart contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110749282.5A CN113435893B (en) 2021-07-01 2021-07-01 Security detection method and device for intelligent contract

Publications (2)

Publication Number Publication Date
CN113435893A CN113435893A (en) 2021-09-24
CN113435893B true CN113435893B (en) 2022-05-17

Family

ID=77758665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110749282.5A Active CN113435893B (en) 2021-07-01 2021-07-01 Security detection method and device for intelligent contract

Country Status (2)

Country Link
CN (1) CN113435893B (en)
WO (1) WO2023274398A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113435893B (en) * 2021-07-01 2022-05-17 支付宝(杭州)信息技术有限公司 Security detection method and device for intelligent contract

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020035871A1 (en) * 2018-08-17 2020-02-20 Telefonaktiebolaget Lm Ericsson (Publ) Method and system for prediction of smart contract violation using dynamic state space creation
CN111125716A (en) * 2019-12-19 2020-05-08 中国人民大学 Method and device for detecting Ethernet intelligent contract vulnerability
CN111524007A (en) * 2020-04-16 2020-08-11 广州拉卡拉信息技术有限公司 Embedded intrusion detection method and device for intelligent contract
CN112631611A (en) * 2021-01-06 2021-04-09 中山大学 Intelligent Pompe deception contract identification method and device
CN112711760A (en) * 2020-12-29 2021-04-27 华南师范大学 Detection method and device for detecting vulnerability of intelligent contract malicious elimination reentry influence
CN112749389A (en) * 2020-12-29 2021-05-04 华南师范大学 Detection method and device for detecting vulnerability of intelligent contract damage sensitive data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11144893B2 (en) * 2017-10-30 2021-10-12 Nec Corporation Method and system for securing smart contracts in blockchains
CN112115472A (en) * 2020-08-12 2020-12-22 北京智融云河科技有限公司 Data management and control oriented intelligent contract code checking method and system
CN113435893B (en) * 2021-07-01 2022-05-17 支付宝(杭州)信息技术有限公司 Security detection method and device for intelligent contract

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020035871A1 (en) * 2018-08-17 2020-02-20 Telefonaktiebolaget Lm Ericsson (Publ) Method and system for prediction of smart contract violation using dynamic state space creation
CN111125716A (en) * 2019-12-19 2020-05-08 中国人民大学 Method and device for detecting Ethernet intelligent contract vulnerability
CN111524007A (en) * 2020-04-16 2020-08-11 广州拉卡拉信息技术有限公司 Embedded intrusion detection method and device for intelligent contract
CN112711760A (en) * 2020-12-29 2021-04-27 华南师范大学 Detection method and device for detecting vulnerability of intelligent contract malicious elimination reentry influence
CN112749389A (en) * 2020-12-29 2021-05-04 华南师范大学 Detection method and device for detecting vulnerability of intelligent contract damage sensitive data
CN112631611A (en) * 2021-01-06 2021-04-09 中山大学 Intelligent Pompe deception contract identification method and device

Also Published As

Publication number Publication date
WO2023274398A1 (en) 2023-01-05
CN113435893A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
US10338956B2 (en) Application profiling job management system, program, and method
CN107979508B (en) Micro-service test method and device
CN110287702B (en) Binary vulnerability clone detection method and device
KR101687213B1 (en) Dynamically loading graph-based computations
US8516443B2 (en) Context-sensitive analysis framework using value flows
US10303587B2 (en) System and method for generating regression test suite
CN106933733B (en) Method and device for determining memory leak position
CN111666206B (en) Method, device, equipment and storage medium for acquiring influence range of change code
CN107766236B (en) Test task automatic management method, device, equipment and storage medium
US20150363195A1 (en) Software package management
JP7394211B2 (en) Methods, devices, equipment, and media for parallel execution of smart contracts
US10198576B2 (en) Identification of mislabeled samples via phantom nodes in label propagation
CN105631337A (en) System and method for controlling access to a native image of a machine code to operating system resources
CN113435893B (en) Security detection method and device for intelligent contract
US11868465B2 (en) Binary image stack cookie protection
US9716625B2 (en) Identifying compatible system configurations
US9064042B2 (en) Instrumenting computer program code by merging template and target code methods
CN111448552A (en) Observation and classification of device events
CN108733536B (en) Monitoring management system and method
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN113626823B (en) Method and device for detecting interaction threat among components based on reachability analysis
US20220335135A1 (en) Vulnerability analysis and reporting for embedded systems
US20230315843A1 (en) Systems and methods for cybersecurity alert deduplication, grouping, and prioritization
CN117688564B (en) Detection method, device and storage medium for intelligent contract event log
CN106649565B (en) A kind of on-line analytical processing method

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