Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

53 results about "Program Dependence Graph" patented technology

In computer science, a program dependence graph (PDG) is a representation, using graph notation, that makes data dependencies and control dependencies explicit. These dependencies are used during dependence analysis in optimizing compilers to make transformations so that multiple cores are used, and parallelism is improved.

Storage type XSS attack detection method and device based on large language model

The invention provides a storage type XSS attack detection method and device based on a large language model, and the method comprises the steps: receiving an initial cue word, inputting the initial cue word into a cue word expander, carrying out the extension of the initial cue word, carrying out the performance evaluation to screen out a cue word meeting a preset performance index, carrying out the multi-round extension and evaluation, and obtaining a detection result. Until the optimized cue word is obtained; the method comprises the following steps: receiving a to-be-detected code, generating a program dependency graph of the to-be-detected code, decomposing the program dependency graph of the to-be-detected code into a plurality of sub-graphs with consistent program structures to obtain a plurality of sub-program dependency graphs, traversing nodes in each sub-program dependency graph, and reserving an original structure of a program; the nodes are sequentially converted into an original code format to obtain code representation fragments, the code representation fragments and the optimized cue words are input into a large language model to judge whether each code fragment is an attack vector of a storage type XSS or not, and a final speculation result is obtained. The method has the advantages of low detection cost, high accuracy and high efficiency.
Owner:NAT UNIV OF DEFENSE TECH

Code quality adaptive evaluation and optimization method, system, equipment and medium

The invention provides a code quality adaptive evaluation and optimization method, system and device and a medium, and belongs to the technical field of computers. The method comprises the following steps: performing redundant information cleaning and standardization processing on an original code; selecting an adaptive parser to convert the processed code into an abstract syntax tree, and optimizing the abstract syntax tree; performing embedding processing on each node of the abstract syntax tree by using a pre-trained deep learning model to generate a node semantic vector, and performing aggregation, feature extraction and vector normalization operation to obtain a semantic vector representing code semantic features; extracting a dependency relationship from the abstract syntax tree to construct a program dependency graph, extracting node features by using a neural network model, and generating a dependency relationship analysis result; based on the semantic vector and the dependency analysis result, identifying a code potential problem by using an optimization algorithm and generating an optimization suggestion; codes are automatically modified according to optimization suggestions, the optimization effect is re-evaluated, and related models and algorithms are iteratively optimized according to feedback information.
Owner:浪潮智慧科技有限公司 +2

Test generation and defect prediction method and system based on heterogeneous program diagram

The invention discloses a test generation and defect prediction method and system based on a heterogeneous program diagram, and the method comprises the steps: constructing a heterogeneous dynamic program dependency diagram: extracting an abstract syntax tree, a control flow diagram and a program dependency diagram of a source code through static analysis, capturing an execution track during operation in combination with dynamic instrumentation, and integrating version evolution information, forming a heterogeneous dynamic program dependency graph containing various types of nodes and edges; heterogeneous graph neural network modeling: designing a four-layer eight-header heterogeneous graph neural network model based on the heterogeneous dynamic program dependency graph, and outputting a function level defect probability and a test case sequence by adopting a type awareness attention mechanism and time coding injection; and multi-task joint training and reasoning: adopting an end-to-end training strategy, jointly optimizing defect prediction loss and test generation loss, preferentially screening high-risk functions during reasoning, and generating a coverage test case. According to the method, the defect detection accuracy is remarkably improved, the test coverage rate is increased, and the method is suitable for enterprise-level complex software systems.
Owner:NO 15 INST OF CHINA ELECTRONICS TECH GRP

Binary code block semantic information automatic capturing method and related device

The invention discloses a method for automatically capturing semantic information of a binary code block and a related device, and relates to the technical field of computers.The method comprises the following steps that code disassembling and instruction level analysis are conducted on the binary code block, and a binary stream original instruction sequence is generated; performing semantic intermediate representation conversion and vocabulary overflow standardization on the binary stream original instruction sequence to obtain a binary code standardized instruction sequence; obtaining an instruction data dependency relationship and an instruction control dependency relationship corresponding to the binary code block, and constructing a corresponding binary code program dependency graph; semantic code node embedding is carried out on the binary code program dependency graph to generate a binary code representation vector corresponding to context semantics; and performing automatic semantic capture reasoning on the binary code representation vector corresponding to the context semantics through a pre-trained semantic understanding model to obtain semantic information of the binary code block. According to the method, the semantic information of the binary code block can be efficiently and accurately captured.
Owner:HUANENG POWER INT INC +1

PLC variable incidence relation analysis method and device based on weight calculation and electronic equipment

The invention discloses a PLC variable association relationship analysis method and device based on weight calculation and electronic equipment. The method comprises the following steps: constructing a program dependency graph representing a PLC variable dependency relationship; according to the program dependency graph, quantifying association strength between PLC variables, and calculating to obtain a dependency edge weight; according to the dependency edge weight, calculating an association relationship score between the PLC variables, and identifying to obtain the association relationship score between the PLC variables; and determining potential attack point risk information of the industrial control system according to the identified association score, and guiding a defense system to discover an intrusion point or a fault source. According to the embodiment of the invention, the strong association relationship before the variable can be comprehensively and reliably identified; in addition, direct dependence between variables can be accurately recognized, indirect influence relations are captured, and the method can be widely applied to the technical field of computers.
Owner:GUANGZHOU UNIVERSITY

Contract vulnerability detection method and system based on cross-granularity feature fusion and meta-learning

The invention discloses a contract vulnerability detection method and system based on cross-granularity feature fusion and meta-learning, and relates to the technical field of block chain security, the method comprises the following steps: obtaining a source code and a compiled byte code of a contract to be detected; source code semantic features are extracted from the source code, operation code execution features are extracted from the byte code, and graph structure features are extracted after a program dependency graph is constructed from the source code; performing cross-granularity attention interaction to generate cross-granularity fusion features; performing type-aware feature modulation on the cross-granularity fusion feature and a vulnerability type identifier of the current detection task, training a classifier by adopting a meta-learning strategy, and outputting a vulnerability detection result; and in response to the vulnerability detection result that the vulnerability exists, positioning the vulnerability code position based on the graph-source code attention weight matrix generated in the cross-granularity attention interaction process, thereby solving the problem of poor generalization ability in a rare vulnerability scene with scarce samples.
Owner:CHENGDU UNIV OF INFORMATION TECH

Binary vulnerability retrieval and positioning method and system based on high-dimensional vulnerability characterization

The invention relates to the field of code vulnerability detection, in particular to a binary vulnerability retrieval and positioning method and system based on high-dimensional vulnerability characterization, and the method comprises the steps: firstly inputting a binary file, analyzing the structural information of the binary file, and analyzing a machine instruction; extracting binary file function information, generating a cross-platform basic block IR instruction sequence, constructing a control flow graph, and constructing a data dependency graph; splicing the program dependency graph feature vector and the basic block IR instruction sequence feature vector, and performing multi-modal feature fusion to generate a comprehensive high-dimensional vulnerability representation vector; and finally, inputting the high-dimensional vulnerability representation vector into an index for searching to obtain a plurality of nearest neighbor indexes and distances, converting the distances into similarity, filtering according to a similarity threshold to obtain a most similar vulnerability vector, and obtaining vulnerability information and vulnerability positions corresponding to the vulnerability vector. The problems that traditional binary vulnerability detection cross-platform and compiler optimization detection fails and the result reliability is low are solved.
Owner:HUANENG POWER INT INC +1

Method and system for generating coverage loop boundary test case based on program slices

The invention discloses a method and a system for generating a test case for covering a loop boundary based on program slices. The method comprises the following steps of: inputting a source code to be tested and a target loop line number; the method comprises the following steps: analyzing a to-be-tested source code based on an abstract syntax tree technology, and extracting key node information to construct a program dependency graph; collecting related code lines through graph traversal by taking a loop structure needing to be analyzed as a criterion, and generating a minimum executable loop slice; performing symbolic execution on the minimum executable loop slice, simulating a loop execution process, capturing condition judgment nodes, and forming a track dictionary; determining a strategy based on the trajectory dictionary and the variable state, and when the strategy is numerical search, performing parameter space exploration; when the strategy is symbolic analysis, analyzing the cyclic condition expression and solving the optimal parameter; generating candidate test cases based on the analysis result; executing the candidate test case, calculating the number of loop iterations, and determining whether an expected state is reached; and if the expected state is reached, outputting a final test case.
Owner:NANJING UNIV OF AERONAUTICS & ASTRONAUTICS

A variable correlation-based PLC information security analysis model construction method

The application provides a PLC information security analysis model construction method based on variable association, which comprises the following steps: analyzing PLC code to obtain PLC variables, combining variable pairs according to network blocks, splicing variable pairs in a global range to obtain global variable dependency relations, constructing a weighted PLC program dependency graph according to the global variable dependency relations and SCADA log features, cleaning the relationship edges of the weighted PLC program dependency graph, and enhancing the dependency strength of the dependency edges of the cleaned weighted PLC program dependency graph to generate a PLC information security analysis model. The method can simultaneously act on two levels of structure optimization and weight optimization, and realize stable reconstruction of PLC dependency relations. Not only can the method effectively remove redundant dependency edges, but also can maintain the stability of key dependency relations under the conditions of data drift and noise interference, and significantly improve the accuracy and robustness of the PLC information security analysis model.
Owner:GUANGZHOU UNIVERSITY

Static analysis tool test case generation method based on program slicing technology

The invention discloses a static analysis tool test case generation method based on a program slicing technology, which comprises the following steps: step 1) according to a defect report of a static analysis tool, collecting and extracting variable information related to generation of a specific defect in a program as a slicing criterion; 2) through control flow analysis and data flow analysis, recording data and a control dependency relationship between statements, constructing a program dependency graph, and calculating a statement set having a dependency relationship with a slicing criterion; 3) positioning nodes corresponding to the statement set in the abstract syntax tree of the source code through a depth-first search algorithm, and deleting other nodes; the method comprises the following steps of (1) collecting a user-defined type or an external function declaration which is used through static program analysis, and outputting the type definition and the function declaration to an independent header file, and (5) writing edited codes into a file, and clearing redundant information to serve as a test case, the method adopts two-section analysis, and the test case can be generated efficiently and precisely.
Owner:NANJING UNIV

Binary program vulnerability detection method and related device

The invention belongs to the technical field of power system security protection, and discloses a binary program vulnerability detection method and related device.The binary program vulnerability detection method comprises the steps that a VEX instruction of a to-be-detected binary program is obtained, and a program dependency graph is generated according to the VEX instruction; disassembling the to-be-detected binary program to obtain an assembly instruction, traversing the program dependency graph based on a preset sensitive operation instruction, and performing operand granularity slicing of the assembly instruction to obtain assembly instruction slices; a pre-trained encoder model is adopted to obtain feature vectors of the assembly instruction slices; and according to the feature vector of the assembly instruction slice, based on a pre-trained vulnerability detection model, obtaining a vulnerability detection result of the assembly instruction slice. According to the method, accurate dependency analysis is carried out around operands, a large number of irrelevant instruction interferences in binary program codes are effectively filtered out, most sensitive operations generating vulnerabilities can be covered based on preset sensitive operation instructions, the noise influence of redundant information on a model is reduced, and the robustness and generalization ability of detection are improved.
Owner:CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +1

A method for detecting vulnerabilities of smart contracts based on self-supervised learning

This invention relates to the field of smart contract security and discloses a smart contract vulnerability detection method based on self-supervised learning. The aim is to obtain effective structured representations of smart contract vulnerabilities at the bytecode level, and to improve the robustness of smart contract vulnerability detection by learning key features related to vulnerabilities through self-supervised learning. The method includes: collecting smart contract bytecode; constructing a smart contract opcode program dependency graph; extracting vulnerability-related program dependency graph slices to construct a self-supervised learning dataset and a vulnerability detection model training dataset; training a self-supervised learning model using the self-supervised learning dataset and extracting program dependency graph slice features; training a smart contract vulnerability detection model using the vulnerability detection model dataset; and using the trained self-supervised learning model to extract vulnerability-related features of the smart contract under test, and inputting these features into the trained smart contract vulnerability detection model for vulnerability detection.
Owner:UNIV OF ELECTRONICS SCI & TECH OF CHINA +2

Source code vulnerability detection method and device based on graph neural network and multi-branch feature fusion and medium

The invention provides a source code vulnerability detection method and device based on a graph neural network and multi-branch feature fusion and a medium, and the method comprises the steps: carrying out the static analysis of an input source code, and constructing a program dependency graph; coding the text information of the nodes in the program dependency graph based on a pre-training language model to generate a semantic embedding representation of structure perception; in combination with centrality index analysis, converting the program dependency graph, and constructing a converted three-channel image; constructing a feature extraction network, and performing feature extraction on the program dependency graph, the text information and the three-channel image through the feature extraction network to obtain graph features, text features and image features; and fusing the graph features, the text features and the image features through an adaptive feature fusion module, and inputting the fused features into a full-connection layer classifier to complete vulnerability classification. According to the method, potential problems in source codes can be comprehensively understood and analyzed, and the accuracy of vulnerability detection is remarkably improved.
Owner:HUZHOU UNIVERSITY

Program dependency graph feature-based metamorphic relation identification method and device

The invention relates to the technical field of computers, in particular to a metamorphic relation identification method based on program dependency graph features. The method comprises the following steps: obtaining a control flow graph (CFG) of a target program, and obtaining a control dependency graph according to the control flow graph and a forward dominating tree; obtaining a program dependency graph according to the control dependency graph and the data dependency relationship; according to a program analysis requirement slicing criterion C = (N, V) of a target program, graph traversal is conducted on the program dependency graph, program slicing features are obtained, N represents instructions in the target program, and V represents a variable set; and inputting the program slice features into a target prediction model for identification, and obtaining a prediction result corresponding to the metamorphic relationship of the target program. By the adoption of the method and device, the metamorphic relation obtaining accuracy can be improved, the situation that the metamorphic relation cannot be obtained is reduced, program testing convenience can be improved, and software quality is improved.
Owner:HUANENG NUCLEAR ENERGY TECH RES INST CO LTD +1

Deep learning based cross-file call vulnerability mining method

The application discloses a cross-file calling vulnerability mining method based on deep learning, and the method comprises the following steps: 1) converting the source code of a current file to be detected into a program dependency graph; 2) traversing the graph nodes on the basis of the program dependency graph, observing the function calling relationship through the graph node information, and fusing the graph features of the current file and the called file into PDGcross features; 3) processing the PDGcross features into a feature matrix, labeling each matrix with a vulnerability label, and generating training samples; and 4) training a classification model on a dataset containing labels by using a neural network, and performing vulnerability detection and vulnerability category prediction. The method has excellent recognition rate and accuracy in detecting unknown vulnerabilities and in detecting multi-file calling vulnerabilities.
Owner:WUHAN JIAOYUN HUIZHI INFORMATION TECH CO LTD

A method, apparatus, device, and medium for automatic translation of deep learning code.

This disclosure provides an automatic translation method, apparatus, device, and medium for deep learning code. The method includes: acquiring source code written on a deep learning framework based on a first heterogeneous computing hardware; parsing the source code to extract its lexical sequence and program dependency graph; inputting the lexical sequence and program dependency graph into a graph-aware cross-attention Transformer model to generate a set of candidate target code that satisfies constraints of lexical consistency, structural consistency, and behavioral consistency; performing API-level replacement and reconstruction on the set of candidates through operator alignment mapping and symbol synthesis search; performing multi-dimensional consistency verification on the reconstructed candidate code; and outputting the verified target code. According to embodiments of this disclosure, the migration of deep learning code between different heterogeneous computing hardware eliminates the need for manual reconstruction and debugging, significantly shortening the adaptation cycle and reducing human resource investment and professional knowledge threshold.
Owner:CHINA UNITED NETWORK COMM GRP CO LTD

Vulnerability detection method based on dual attention mechanism and code similarity

The present invention proposes a vulnerability detection method based on a dual attention mechanism and code similarity, which belongs to the field of vulnerability detection technology. It includes: extracting the program dependency graph corresponding to the unknown function to be tested, expanding the abstract syntax tree corresponding to the statement to each node of the program dependency graph to form a composite graph; using the marked vulnerability statement as a slicing criterion, finding the slicing node in the program dependency graph as the root node, expanding the abstract syntax tree to form a slice composite graph; learning the syntax and semantic information within the statement, generating an initial embedding vector of the statement node composed of semantic and syntax feature vectors; learning the structural features of the source code, obtaining the slice composite graph and the vector representation of the composite graph, and calculating the similarity between the two; when the similarity exceeds a certain threshold, the target function is defined as a potential vulnerability function. This method solves the problem of vulnerability detection methods that lack vulnerability information that can effectively exploit known vulnerability codes while ignoring or even eliminating redundant irrelevant information in the code.
Owner:HARBIN INST OF TECH +1

Intelligent contract vulnerability detection method and device, electronic equipment and storage medium

The invention provides an intelligent contract vulnerability detection method and device, electronic equipment and a storage medium, and can be applied to the technical field of block chains. The method comprises the following steps: based on code data of a to-be-detected smart contract, obtaining a program dependency graph of the code data; inputting the program dependency graph into a pre-constructed feature extraction model, and obtaining fusion features output by the feature extraction model; inputting the fusion feature into a pre-constructed classifier model, and obtaining a contract vulnerability tag output by the classifier model; wherein the contract vulnerability tag is used for identifying the vulnerability code in the code data. According to the method, the structural features and the semantic features of the to-be-detected smart contract are fused in the detection process, so that the accuracy and the reliability of vulnerability detection are improved.
Owner:INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Static stain analysis white-box testing method, device and equipment based on mutual information entropy

The invention discloses a static taint analysis white-box testing method, device and equipment based on mutual information entropy, and relates to the technical field of test.The method comprises the steps that a taint source and a taint sink are determined, and a program flow chart is constructed; checking the state of the stain sink based on a program dependency graph in the program flow chart, and filtering and optimizing the path of the program to obtain a path simplification graph of the program; performing static taint analysis on the path simplification diagram, performing taint marking on variables with a data dependency relationship according to a taint propagation rule, and calculating a polluted probability of statement variables with a control dependency relationship in combination with a mutual information formula in a quantitative information flow technology so as to realize taint marking; and traversing each dependency set containing the stain mark nodes along the path simplification graph, and generating a stain propagation path graph. According to the method, the taint marking problem under the control dependency relationship can be effectively solved, and the vulnerability injection attack resisting capability and reliability of a program are improved.
Owner:DONGFENG ELECTRONICS TECH

Incremental test context generation method and system based on minimum patch graph

The invention provides an incremental test context generation method and system based on a minimum patch graph. The method comprises the following steps: constructing a cross-file program dependency graph containing control, data and call dependencies at the same time; performing semantic slicing by taking the modified row set as a seed; an improved Tarjan-Lengauer algorithm containing read-only dependency pruning and parallel path compression is adopted to solve a minimum dominating set; generating a minimum patch graph [delta]-Context, and carrying out serialization by using a customized DSL (Digital Subscriber Line); and then only the delta-Context related file is compiled, and the influenced test case set is executed. According to the method, a cross-file program dependency graph + semantic slicing + improved Tarjan-Lengauer minimum dominating set technology is adopted, and the problems of large patch redundancy, wide test range, high false alarm rate and the like of traditional row-level diff in incremental compiling and regression testing are solved.
Owner:AACAT TECHNOLOGY LTD

Binary program analysis, storage and query method and system

The invention provides a binary program analysis, storage and query method and system. The method comprises the following steps: performing multi-level program semantic analysis on an input binary program file; on the basis of a node and edge attribute mapping rule of the graph database, storing path nodes and associated edges to Neo4j, and then establishing an address hash index; and finally, performing program vulnerability query based on a hybrid query engine, and returning all unverified calling points and upstream data flow paths thereof. According to the method, the whole-process coverage from program analysis to intelligent query is realized by constructing a structured program dependency graph and combining a multi-modal analysis engine and graph database storage optimization; control flow, data flow and symbol constraints can be captured at the same time, and cross-function vulnerability analysis can be carried out; according to the method, the query delay is reduced by 50% by utilizing the associated storage mode of the graph database; complex semantic query can be achieved through the mixed query engine, symbolic execution verification is conducted on the query path, and feasibility of the query path is ensured.
Owner:SUN YAT SEN UNIV +1

Vulnerability detection method and device based on graph neural network, and electronic equipment

The invention relates to the technical field of information security, in particular to a vulnerability detection method and device based on a graph neural network and electronic device.The vulnerability detection method based on the graph neural network comprises the steps that program source codes are analyzed to obtain a program dependency graph, node embedding is conducted on the program dependency graph, and the program dependency graph is obtained; obtaining a node feature vector; inputting the node feature vectors into a trained gating graph neural network model, wherein the gating graph neural network model enhances node feature representation; and classifying the node feature vectors by using convolution pooling and a multi-layer perceptron, and predicting whether the program source code has vulnerabilities or not. The software vulnerability detection method and device can effectively improve the accuracy and efficiency of software vulnerability detection.
Owner:TIANJIN UNIV

A vulnerability detection method based on a hierarchical centrality fusion strategy and a double-channel convolutional neural network

The application provides a vulnerability detection method based on a hierarchical centrality fusion strategy and a double-channel convolutional neural network, and belongs to the technical field of source code vulnerability detection. The method comprises the following steps: 1, denoising and normalizing the source code function for preprocessing, to generate a standardized code text; 2, parsing the standardized code text into a program dependency graph, and weighting and integrating the code semantic features and the centrality structure features of the graph nodes; 3, based on the hierarchical centrality fusion strategy, the integrated feature matrix is hierarchically mapped according to the local, propagation and global topological properties, to generate a multi-view RGB image representation; and 4, a double-channel convolutional neural network is constructed, deep features of the multi-view RGB image are extracted in parallel, and the vulnerability classification detection is completed based on the fused enhanced features.
Owner:JIANGSU UNIV

Vulnerability mining method and device based on multi-task learning

The application discloses a vulnerability mining method and device based on multi-task learning, and the method comprises the following steps: based on the abstract syntax tree, the control flow graph and the program dependency graph of the source code, a code attribute graph is constructed; the tree structure and the graph structure in the code attribute graph are separated; the nodes in the tree structure are encoded to obtain the initial node vector representation of the abstract syntax tree; the initial node vector representation of the abstract syntax tree, the tree structure and the graph structure are respectively input into a vulnerability recognition neural network model and a vulnerability positioning neural network model to obtain a vulnerability recognition result and a vulnerability positioning result. In order to solve the problems that the accuracy of the existing learning-based source code vulnerability mining method needs to be improved and the detection granularity is coarse, the application proposes a vulnerability mining method based on multi-task learning. The application can accurately identify the vulnerability and position the vulnerability at the same time, and improve the security vulnerability mining ability of the vulnerability mining personnel.
Owner:INST OF SOFTWARE - CHINESE ACAD OF SCI

Memory allocation vulnerability detection method and device, equipment and storage medium

The invention provides a memory allocation vulnerability detection method and device, equipment and a storage medium. The invention relates to the field of vulnerability detection. A memory allocation vulnerability detection method comprises the steps of performing static analysis on a to-be-detected binary code to obtain a program dependency graph; according to a memory allocation function in a preset memory allocation path and a first constraint condition, performing slicing operation on the program dependency graph to obtain a plurality of initial sub-graphs; a vulnerability detection model based on a graph neural network is used to screen the plurality of initial sub-graphs, and a plurality of vulnerability sub-graphs are determined; and performing vulnerability detection on the plurality of vulnerability sub-graphs to obtain a memory allocation vulnerability detection result of the to-be-detected binary code.
Owner:INST OF MICROELECTRONICS CHINESE ACAD OF SCI LTD

A vulnerability detection method based on graph embedding and bidirectional gated graph neural network

The application provides a vulnerability detection method based on graph embedding and a bidirectional gated graph neural network. First, function-level source code containing vulnerabilities and source code not containing vulnerabilities extracted from source code are obtained, all the source code is converted into a program dependence graph including a control dependence graph and a data dependence graph by using a source code analysis tool, and then the improved node2vec method is used to convert the program dependence graph into a code graph embedding representation, which contains both the graph structure information of the source code and the text structure information of the source code, and to a certain extent, the ability of the feature to represent nonlinear information is improved, and finally, the code embedding after the pretreatment is trained by using a bidirectional gated graph neural network model. The training result is applied to a target program to detect and evaluate the code vulnerability of the target program.
Owner:HANGZHOU DIANZI UNIV

Software row-level defect prediction method based on hierarchical attention mechanism

The invention discloses a software row-level defect prediction method based on a hierarchical attention mechanism, and the method comprises the steps: converting each row of statements in a source code file into vector representation through employing a CodeBERT pre-training model, so as to obtain the semantic information of a code row; extracting a program dependency graph of the source code, recording a mapping relation between each node in the program dependency graph and a source code line, and calculating a network measurement index corresponding to each node; fusing the semantic vectors of the code lines and the network measurement indexes to generate fused node features so as to construct a program dependency graph after the node features are expanded; constructing a HAGLineDP model, wherein the HAGLineDP model comprises a graph feature extraction network and a dual-task classification network; the graph feature extraction network designs three-level feature evolution paths from local to global and from structure to semantic, and sequentially comprises a local structure aggregation layer, a structure generalization enhancement layer and a semantic importance weighting layer; the dual-task classification network comprises a node classification path and a graph classification path; and training the HAGLineDP model by using a joint loss function and an AdamW optimizer, outputting the defect probability of each code line for a to-be-predicted source code file through a node classification path, and sorting according to the defect probability to locate a high-risk code line. According to the method, fine positioning of code defects can be effectively completed, and efficient distribution and utilization of software testing resources are promoted.
Owner:NANJING UNIV OF SCI & TECH

A smart contract vulnerability detection method based on operation code program dependence graph

The application relates to the field of smart contract security and discloses a smart contract vulnerability detection method based on an operation code program dependency graph, which aims to obtain effective smart contract vulnerability related semantic information from the bytecode level and improve the accuracy of automatic detection of smart contract vulnerabilities. The method comprises the following steps: collecting a smart contract bytecode dataset and marking operation codes that may trigger vulnerabilities; simulating the execution of a smart contract operation code sequence, constructing a smart contract operation code control flow graph and a data dependency graph; constructing a smart contract operation code program dependency graph; taking the operation codes that may trigger vulnerabilities as key nodes, extracting vulnerability related program dependency graph slices, combining the marked information to construct a slice dataset; encoding the program dependency graph slices; training a smart contract vulnerability detection model based on a graph neural network to extract slice features and realize smart contract vulnerability detection.
Owner:UNIV OF ELECTRONICS SCI & TECH OF CHINA +2

Function level vulnerability detection method based on source code annotation and program dependency graph

The invention relates to the field of software security technology and the like, discloses a function-level vulnerability detection method based on source code annotation and a program dependency graph, and aims to realize function-level vulnerability detection by fusing code annotation and code statement features and using the program dependency graph as a code representation mode. A graph convolutional neural network is used for learning structure information and grammar semantic information of codes, the vulnerability detection rate is effectively improved, meanwhile, the mode has good expandability, and the method comprises the following steps that nonstandard annotation information existing in the codes is removed, and the codes are subjected to standardization processing; generating a program dependency graph (PDG) of the normalized code; generating annotation information for each node by using the large model to obtain a program dependency graph containing the code statements and the annotation information of the code statements; the vector representation of the code annotation information and the vector representation of the code statement are generated, and then the two vector representations are fused into a fused feature vector which is used for subsequently inputting the overall architecture of the graph neural network to carry out model training.
Owner:SICHUAN UNIV

Code review method and device based on program dependency graph

The invention provides a code review method and device based on a program dependency graph, computing equipment and a computer readable storage medium, the method adopts a deep semantic difference analysis method based on the program dependency graph, and non-functional changes such as code formats, annotations and variable renaming are effectively ignored; secondly, functional equivalent reconstruction operations such as an extraction method can be accurately identified by utilizing the structural characteristics of the program dependency graph; and thirdly, through a bidirectional traversal algorithm, automatically tracking and aggregating cross-file and cross-module data and control dependence, aggregating fragmented association modifications into logic cohesion'function change blocks', and presenting core changes and influences brought by the changes in a one-stop manner through a visual difference comparison report, so as to obtain a function change block. Therefore, the efficiency, the accuracy and the safety of code review are fundamentally improved.
Owner:BEIJING XUEJING TECHNOLOGY CO LTD +1