# Security Feature Measurement for Frequent Dynamic Execution Paths in Software System

Authors: Qian Wang; Jiadong Ren; Xiaoli Yang; Yongqiang Cheng; Darryl N. Davis; Changzhen Hu
Journal: Security and Communication Networks
 (2018)

---

## Abstract

The scale and complexity of software systems are constantly increasing, imposing new challenges for software fault location and daily maintenance. In this paper, the Security Feature measurement algorithm of Frequent dynamic execution Paths in Software, SFFPS, is proposed to provide a basis for improving the security and reliability of software. First, the dynamic execution of a complex software system is mapped onto a complex network model and sequence model. This, combined with the invocation and dependency relationships between function nodes, fault cumulative effect, and spread effect, can be analyzed. The function node security features of the software complex network are defined and measured according to the degree distribution and global step attenuation factor. Finally, frequent software execution paths are mined and weighted, and security metrics of the frequent paths are obtained and sorted. The experimental results show that SFFPS has good time performance and scalability, and the security features of the important paths in the software can be effectively measured. This study provides a guide for the research of defect propagation, software reliability, and software integration testing.


---

## Body

## 1. Introduction

The increase in complexity of software requirements makes software developers unsure of the development quality of software system; in effect the “software crisis” still has not been completely solved. How to effectively excavate the inherent characteristics of the software system structure, to recognize, measure, manage, and control the complexity of software structure, becomes a key problem for solving the development bottleneck in the software industry.Research on the complexity of software network structure can combine the methods of complex system science and statistical physics. Depending on the granularity, software systems can be composed of different types of software entities, such as functions, classes, subroutines, packages, and artifacts. With these entities interacting with each other, software systems can achieve specific functional requirements. If the software entities are viewed as nodes and the relationship between the nodes is abstracted as edges, the software execution process presents a nonlinear network structure according to the relationship of the entities [1] and also a linear sequence structure according to the sequential characteristics of the execution order. Then, the software system can be expressed as an abstracted complex network model and a sequence model, which provides a new train of thought [2] for the description of the software system.The root cause of the security danger hidden in software lies in the vulnerability of the entity itself. The vulnerability is the measurement of the potential danger of a software entity to be used as an attack and can be discussed from the perspective of computer network [3, 4] or software static code analysis, but the integrity (whole structure) and the dynamic execution (behavior characteristic) of software system are ignored. In addition, the degree to which software system security is threatened depends not only on the severity of the fault, but also on the fault propagation capacity of the entity. If one or more functions fail, the fault may be propagated to other functions by invocation relationships and further lead to a part of or the whole software system crashing, known as “cascading failure” [5]. Therefore, the software security feature measurement should take into account the vulnerability and propagation of software entities.How to quantitatively measure the security features of nodes from the software complex network is the premise and basis for further analysis of the software behavior trajectory path. At present, there are lots of methods for discovering the important nodes in complex networks. The classic methods based on centricity contain degree centrality [6], closeness centrality [7], betweenness centrality [8], eigenvector centrality [9], subgraph centricity [10], and so on. The classic methods based on random walk model include PageRank [11], LeaderRank [12], and their improved algorithm NodeRank [13]. Wang and Lü [14] by means of the influence node mining method prove that the defect propagation capacity of a node is stronger if the in-degree and out-degree of the node are bigger. Huang et al. [15] based on the invocation and dependency relationships between functions with the fault probability of nodes calculate the fault accumulation degree of upper nodes by the iteration from the leaf nodes. These methods attempt to describe the relevance of software node importance to fault generation and propagation, but fail to form a measurement of software security.Sequence or path is the most basic and important way for the description of dynamic software execution process. The full execution path of the whole software can reflect the occurrence order and frequency of the software internal entities. However, the method of path extraction and mining is restricted by the nested, circulatory, iteration and the continuous invocation relationships of entities. Most software path mining algorithms are extracted on the basis of complex networks. For example, Tang et al. [16] propose an algorithm for shortest path mining between any two vertices in complex network. Zhang et al. [17] minimize the length of the extracted path and reduce the unnecessary time overhead by further processing the repetitive structure. The GP method proposed by Nguyen et al. [18] can automatically detect and fix software vulnerabilities according to the software execution path. Murtaza et al. [19] predict future software possible defects by analyzing the historical vulnerability sequence data with characteristics of Markov to provide adequate response time. Zou et al. [20] analyze the reliability of Digital Instrumentation and Control software system based on the flow network model by finding sensitive paths in the complexity software. These algorithms are based on the network to extract path, which can lead to the phenomenon of repeated reading and approximate connection; also, these software security analyses cannot work without existing vulnerability information or real faults as their training data.In this paper, the Security Feature measurement algorithm of Frequent dynamic execution Paths in Software, SFFPS, is proposed. A complex network model and a sequence model are formed based on software dynamic execution behavior. It is for early security feature measurement, before there are real vulnerabilities or faults generated, which can provide the premise for the software quality and reliability evaluation. The main contributions are as follows.( 1 ) The software system is mapped to a complex network model and sequence model, from the nonlinear perspective to effectively express the characterization of complex correlation between software entities and from the linear perspective to capture sequential characteristics of the dynamic execution.( 2 ) The behavior nature of fault accumulation and propagation is analyzed based on the system structure of software dynamic execution and standard measurement of security features (vulnerability and propagation) being defined.( 3 ) Frequent paths in software dynamic execution are mined and weighted by the node security features. The key paths which are worthy of attention are ensured by both their frequency and security features.The remainder of the paper is organized as follows. Section2 gives the model construction. Sections 3 and 4 develop the definition of the security features and the SFFPS algorithm. Section 5 provides some examples. Section 6 presents the performance study of SFFPS and shows the rank of the important paths. Section 7 contains the concluding remarks.


## 2. Constructions of Complex Network Model and Sequence Model

The dynamic execution trace of software systems contains three phases, which are data collection, tracking data simplification, and data visualization as shown in Figure1. The modeling process of simple functions is shown in Figure 2.Figure 1
Theory process of model construction.Figure 2
Modeling process of invocation relationship between simple functions.Phase 1.
Match the entry and exit configuration functions of the GNU compiler toolchain (gcc), and insert the analysis function into the entry and exit of the application functions to trace the function execution process. The tracking results are recorded in the file trace.txt.Phase 2.
The letters “E” and “X” before the tracking addresses represent the entry and exit of a function, respectively. A simplification tool Pvtrace is used to analyze the function invocation according to the letters “E” and “X.” An address transformation tool Addr2line is used and the address is transformed to function name.Phase 3.
Map the function invocation order to sequence model and a visualization tool Graphviz is used to form the complex network, which defines the global relationship between all the functions.According to Figure2, the corresponding relationships of function address and function name are as follows:0x8048690→M(main); 0x804854d→B; 0x8048585→C; 0x80485b8→D.0x80485f0→E; 0x8048623→F, 0x8048656→G.Only the addresses with the letter “E” are used for sequence model construction.


## 3. The Security Feature Definition and Measurement of Function Nodes

The security feature measurement of a function node is based on the software structure; the analysis of vulnerability and propagation is according to cumulative effect and the spread effect caused by the mechanism of fault production and propagation. The global accessibility and fault tolerance with step attenuation effect are fully considered, so the node security features are calculated according to the degree distribution and step attenuation factor.Definition 4 (software complex network).
In a software complex network, functions are defined as the nodes; the invocation relationships between functions are defined as edges.Definition 5 (vulnerability).
Vulnerability of a function node is the characteristic that a function node may break down because of the effect of its invocated fault node through invocation relationship.
Typically, if a node invocates more other nodes, it is more functional and vulnerable. That is to say, it is more likely to be affected and be faulted. The calculation ofV (vulnerability) is as follows:(1)Vu=outDegreeu+∑w∈OSuθ∗Vw,where u, w represent function nodes, Vu represents the vulnerability of node u, OutDegreeu represents the out-degree of node u, θ represents the step attenuation factor, which satisfies θ∈0,1, and OSu represents the direct out-neighbor set of node u.Definition 6 (propagation).
Propagation of a function node is the characteristic that a function node may propagate its fault to the nodes by which it is invocated. The calculation ofP (propagation) is as follows: (2)Pu=inDegreeu+∑w∈ISuθ∗Pw,where P(u) represents the propagation capacity of node u, inDegree(u) represents the in-degree of node u, and IS(u) represents the direct in-neighbor set of node u.Algorithm1 describes the calculation process of vulnerability and propagation.Algorithm 1:Calculation of node security features.
Input: Complex network CN, step attenuation factor θ Output: Node list with security features NFlist for each nodeu in CN V ( u ) = calculation_V(u); P ( u ) = calculation_P(u); NFlist.add u,Vu,Pu; Procedure calculation_V(u) V ( u ) = outDegree(u); For each node w∈OS(u) V ( u ) += calculation_V(w); return V(u); Procedure calculation_P(u) P ( u ) = inDegree(u); for each node w∈IS(u) P ( u ) += calculation_P(w); return P(u);


## 4. Mining Frequent Paths from Dynamic Execution with Security Feature Measurement

The importance of a software dynamic execution path takes into account two aspects: one is the occurrence frequency of the path and the other one is the security feature coming from the nonrepetitive nodes contained in the path. These two aspects are complementary. For example, if there are lots of loop bodies in the software execution, loop body and its subset are always frequent. But because most of its contained nodes are the same, the fault influence range is small. Similarly, if a path contains many different nodes with a lower occurrence frequency, its impact range is large, but its occurrence possibility is small. That is to say, if the frequency of a path is very high and the path contains more nonrepetitive nodes, the path is worthy of more attention.


### 4.1. Relative Definitions of Frequent Path

LetF=f1,f2,f3,…,fn be a set of function symbols. S is a software execution path, and it is composed of function symbols with time-ordered occurrence. Minimal support count (mincount) can be calculated by mincount=minsup∗|S|, where minsup is a given threshold and S is the number of function symbols in S. If there are k symbols in S, S is a k-path.Definition 7 (subpath and superpath).
A pathS1=a1,a2,…,am is a subpath of another path S2=b1,b2,…,bn, denoted as S1⊆S2, if there are numbers i1,i2,…,im, such that 1≤i1<i2<⋯<im≤n and a1⊆bi1, a2⊆bi2,…,am⊆bim. It can also be said that S2 is a superpath of path S1.Definition 8 (support number).
S is a path; the support number of S, denoted as sup⁡S, is defined as its occurrence number in the software execution.Property 9 (frequent path).
A pathS is frequent if its support number sup⁡S is equal to or more than mincount.Property 10 (antimonotone).
If pathA is not a frequent path, any path B containing A, which is a superpath of A, cannot be a frequent path.


### 4.2. Weighting the Frequent Path Based on the Security Features of Function Node

SFFPS algorithm is for mining the security features of frequent paths based on the dynamic execution sequence model and the node security features in the complex network model. It contains two phases: one is frequent path mining and the other one is security feature weighting. First, the function nodes in the sequence model are read to form the function position set. Then, the position index is used for pattern growth; this self-growth strategy can avoid candidate generation and ensure the continuity of function execution. Finally, path frequency is validated by minimum support count mincount, and path is weighted according to the security feature of the nonrepetitive nodes contained in it. The security features of the frequent paths are measured. Algorithm2 describes the mining and weighting process.Algorithm 2:Security feature measurement of frequent paths in software.
Input: Function execution path S, minimal support threshold minsup Output: Path list with security features Slist mincount = minsup ∗ S; for each nodeSi in S Pos(Si).add(Si.pos); for each Pos(Si) sup(Si) = PosSi; if(sup(Si) < mincount) Delete Pos(Si); else L 1 = L1.add(Si, supSi); for (k=2; Lk-1!=∅; k++) gen_mine(Lk-1); for each lm∈L for each different function symbol u in lm { V l m  += V u; P l m  += P u; Sort eachlm∈L by V(lm), P(lm) and form Slist; Procedure gen_mine (Lk-1) for each li∈Lk-1 for each position pos in Pos(li) S j = S [ pos + 1 ]; for each position pos in Pos(li) if (pos+1 exists in Pos(Sj)) Pos(liSj).add(pos + 1); sup(liSj) = PosliSj; if (sup(liSj) < mincount) delete Pos(liSj); else L k = L k.add(liSj);


## 4.1. Relative Definitions of Frequent Path

LetF=f1,f2,f3,…,fn be a set of function symbols. S is a software execution path, and it is composed of function symbols with time-ordered occurrence. Minimal support count (mincount) can be calculated by mincount=minsup∗|S|, where minsup is a given threshold and S is the number of function symbols in S. If there are k symbols in S, S is a k-path.Definition 7 (subpath and superpath).
A pathS1=a1,a2,…,am is a subpath of another path S2=b1,b2,…,bn, denoted as S1⊆S2, if there are numbers i1,i2,…,im, such that 1≤i1<i2<⋯<im≤n and a1⊆bi1, a2⊆bi2,…,am⊆bim. It can also be said that S2 is a superpath of path S1.Definition 8 (support number).
S is a path; the support number of S, denoted as sup⁡S, is defined as its occurrence number in the software execution.Property 9 (frequent path).
A pathS is frequent if its support number sup⁡S is equal to or more than mincount.Property 10 (antimonotone).
If pathA is not a frequent path, any path B containing A, which is a superpath of A, cannot be a frequent path.


## 4.2. Weighting the Frequent Path Based on the Security Features of Function Node

SFFPS algorithm is for mining the security features of frequent paths based on the dynamic execution sequence model and the node security features in the complex network model. It contains two phases: one is frequent path mining and the other one is security feature weighting. First, the function nodes in the sequence model are read to form the function position set. Then, the position index is used for pattern growth; this self-growth strategy can avoid candidate generation and ensure the continuity of function execution. Finally, path frequency is validated by minimum support count mincount, and path is weighted according to the security feature of the nonrepetitive nodes contained in it. The security features of the frequent paths are measured. Algorithm2 describes the mining and weighting process.Algorithm 2:Security feature measurement of frequent paths in software.
Input: Function execution path S, minimal support threshold minsup Output: Path list with security features Slist mincount = minsup ∗ S; for each nodeSi in S Pos(Si).add(Si.pos); for each Pos(Si) sup(Si) = PosSi; if(sup(Si) < mincount) Delete Pos(Si); else L 1 = L1.add(Si, supSi); for (k=2; Lk-1!=∅; k++) gen_mine(Lk-1); for each lm∈L for each different function symbol u in lm { V l m  += V u; P l m  += P u; Sort eachlm∈L by V(lm), P(lm) and form Slist; Procedure gen_mine (Lk-1) for each li∈Lk-1 for each position pos in Pos(li) S j = S [ pos + 1 ]; for each position pos in Pos(li) if (pos+1 exists in Pos(Sj)) Pos(liSj).add(pos + 1); sup(liSj) = PosliSj; if (sup(liSj) < mincount) delete Pos(liSj); else L k = L k.add(liSj);


## 5. An Illustrative Example

The complex network in Figure2 is a variant of the tree-like structure in Figure 3, which is redrawn for easier understanding.Figure 3
Complex network model of simple function invocation relationship.Without losing generality, the coordination factor is set to 0.5. Security features of each node are calculated as follows. As the “main” function is special (vulnerability is always large and propagation is 0), it is excluded for measurement.Vulnerability  V G = outDegree  G = 0. V C = outDegree  C + θ ∗ V G = 1 + 0.5 ∗ 0 = 1. V F = outDegree  F + θ ∗ V G = 1 + 0.5 ∗ 0 = 1. V E = outDegree  E + θ ∗ V F = 1 + 0.5 ∗ 1 = 1.5. V D = outDegree  D + θ ∗ V E + V F = 2 + 0.5 ∗ 1.5 + 1 = 3.25. V B = outDegree  B + θ ∗ V C + V E = 2 + 0.5 ∗ 1 + 1.5 = 3.25.Propagation  P B = inDegree  B = 1; PD=inDegree(D)=1. P C = inDegree  C + θ ∗ P B = 1 + 0.5 ∗ 1 = 1.5. P E = inDegree  E + θ ∗ P B + P D = 2 + 0.5 ∗ 1 + 1 = 3. P F = inDegree  F + θ ∗ P E + P D = 2 + 0.5 ∗ 3 + 1 = 4. P G = inDegree  G + θ ∗ P C + P F = 2 + 0.5 ∗ 1.5 + 4 = 4.75.According to the sequence model of the example,S=MBCGEFGDEFGFG, if the minsup is set to 0.15, mincount=0.15∗12≈2.PosB=1; PosC=2; PosD=7; Pos(E)=4,8.PosF=5,9,11; PosG=3,6,10,12.Frequent 1-Path  E ,  sup ⁡ E = 2, PosE=4,8. F ,  sup ⁡ F = 3, PosF=5,9,11. G ,  sup ⁡ G = 4, PosG=3,6,10,12.The mining method of frequent 2-path is based on the position set of the frequent 1-path by using the adjacent position value as index to find the extended paths. For example, the position set of nodeE is {4,8}, and its extended position set is {5,9}. The function nodes in positions 5 and 9 both correspond to node F. So, Pos EF=5,9 is obtained, sup⁡EF=2, and path EF is a frequent 2-path.Frequent 2-Path  E F , sup ⁡ E F = 2, PosEF=5,9; FG,sup⁡FG=3. Pos  F G = 6,10,12.The security features of frequent 1-path included in the function nodes are calculated as before, and the security features of frequent 2-path are calculated as follows. Table1 shows the security features of all the frequent paths. (3)VEF=VE+VF=1.5+1=2.5;PEF=PE+PF=3+4=7.Table 1
The security features of frequent paths.
Frequent paths sup V P E 2 1.5 3 F 3 1 3 G 4 0 4.75 E F 2 2.5 7 F G 4 1 8.75


## 6. Experimental Results

Experiments are performed on a PC with Intel® Core™ 3.6 GHz CPU and 16 G main memory, running on Windows 8. We evaluate the runtime and scalability of the algorithm SFFPS and calculate the fault feature ranks of nodes and important paths. To test the algorithms in the same coding environment, all the programs are written in Java using MyEclipse. Datasets used in the experiment are open-source software programs of Cflow and Tar obtained from open-source software library (https://sourceforge.net).


### 6.1. Runtime and Scalability Tests of SFFPS

By testing the runtime and scalability of SFFPS, two newest versions of each Cflow and Tar are selected. The support threshold is from 0.005 to 0.01 for runtime test, and the upper threshold 0.01 is used for scalability test. The total runtime is composed of three parts, node fault feature calculation, frequent pattern mining, and weight appending. Figure4 is the runtime test of SFFPS with different support thresholds and Figure 5 is the scalability test with different length percentages of the sequence when the support threshold is set to 0.01.Figure 4
Runtime test of SFFPS with different support thresholds.
(a)
Runtime test of SFFPS in Cflow (b)
Runtime test of SFFPS in TarFigure 5
Scalability test of SFFPS with different percentages of sequence length.
(a)
Scalability test of Cflow with minsup = 0.005 (b)
Scalability test of Cflow with minsup = 0.010 (c)
Scalability test of Tar with minsup = 0.005 (d)
Scalability test of Tar with minsup = 0.010From Figure4, SFFPS performs well in the support threshold range [0.005, 0.010]. This is due to the adjacency table which is for the storage of the complex network model. The calculation of the out-degree and in-degree of the nodes is made easier, which improves the calculation of node security feature. Furthermore, as the sequence model is based on the start order of each function, the detailed invocation and end time of a node are ignored, and the length of the sequence model is simplified. Also, position value index is used for the mining and pattern growth of the paths, which avoids candidate generation, and index methods are always effective. Finally, the weight appending process achieves efficiency because fewer nodes are involved by the strategy of nonrepetition.From Figure5, SFFPS shows good scalability on the software Cflow. With the increase of the length of the sequence, the execution time of SFFPS is essentially a linear growth. From the experimental data, the number of frequent sequences is also increasing. This indicates that the functions of Cflow are uniformly distributed. However, the time overhead of software Tar is quite expensive around 40% of sequence length; the number of frequent sequences increases rapidly from 194 when the percentage is 20% to 1123. After that, the time overhead and the number of frequent sequences reduces. This indicates that there are more core functions in software Tar and there are more invocations of core functions in the early stage of the program.


### 6.2. The Security Features of the Function Nodes

Tables2 and 3 show the security feature rank and value of the function nodes in the newest versions of Cflow and Tar.Table 2
Rank and value of function node security features in Cflow.
Vulnerability Propagation Function name Cflow-1.3 Cflow-1.4 Function name Cflow-1.3 Cflow-1.4 (rank/value) (rank/value) parse_variable_declaration 1/45.05 1/47.07 nexttoken 1/33.73 1/36.17 parse_declaration 2/40.77 2/41.85 tokpush 2/19.74 3/20.96 yyparse 3/37.50 4/38.82 putback 3/19.32 4/19.32 parse_typedef 4/19.33 6/20.78 get_token 4/17.86 5/19.08 tree_output 5/18.50 5/25.56 linked_list_append 5/15.47 2/21.06 func_body 6/18.15 7/18.28 lookup 6/13.79 6/13.94 parse_function_declaration 7/17.80 8/17.99 hash_symbol_hasher 7/12.90 8/13.04 parse_dcl 8/16.92 9/17.41 hash_symbol_compare 7/12.90 8/13.04 expression 9/16.17 10/16.42 yy_load_buffer_state 8/12.86 7/13.27 initializer_list 10/12.53 13/12.72 yylex 9/9.93 11/10.54Table 3
Rank and value of function node security features in Tar.
Vulnerability Propagation Function name Tar-1.27 Tar-1.28 Function name Tar-1.27 Tar-1.28 (rank/value) (rank/value) dump_file0 1/42.84 1/44.09 to_chars 1/17.28 1/17.28 create_archive 2/32.02 2/33.21 assign_string 2/11.67 2/11.67 dump_file 3/25.92 4/27.04 to_octal 3/9.64 3/9.64 dump_regular_file 4/19.37 5/19.37 tar_copy_str 4/7.13 4/7.13 dump_hard_link 5/17.37 6/17.37 set_next_block_after 5/6.64 5/6.64 start_header 6/15.62 8/15.62 find_next_block 6/6.16 6/6.16 dump_dir0 7/15.37 7/16.37 start_header 7/5.84 7/5.84 dump_dir 8/10.68 9/11.18 finish_header 7/5.84 7/5.84 close_archive 9/7.50 11/8.00 current_block_ordinal 7/5.84 7/5.84 _open_archive 10/7.25 10/8.75 flush_archive 8/5.83 8/5.83From Tables2 and 3, the security features of the same function nodes are relatively stable for different versions of the same software. So, in the process of version evolution, it can be inferred and predicted that the same function should have approximate rank in a new software version. Also, the function rank in the old version can be used as a basis for the version upgrade process with function nodes remove, merger, or update. The nodes with larger rank changes should be given more attention.Tables4 and 5 show the frequent paths of Cflow-1.4 in the top 10 security feature ranks of vulnerability and propagation.Table 4
Vulnerability rank and value of frequent paths(minsup=0.01).
Paths Rank/value is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 1/16.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 1/16.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 1/16.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/15.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/15.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 2/15.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol 3/14.75Table 5
Propagation rank and value of frequent paths(minsup=0.01).
Paths Rank/value is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 1/36.35 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/34.48 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/34.48 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 3/34.42 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 3/34.42 include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 4/32.67 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name 5/32.60 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 6/32.54 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 6/32.54 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 6/32.54There are double meanings of the paths listed in Tables4 and 5. One is that the paths are frequent, which first affirms that the occurrence possibility of the path is relatively large. The other one is that the security feature values of the paths are larger, which evaluates the security risk of the path. Only when both of them work together can we make a persuasive security measurement.In addition, the frequency of the path can be used to predict the function nodes that are going to be affected, and the security features of the path can be used to evaluate the possible impact scale of the abnormal path. For example, the main consideration of random fault detection is the vulnerability. According to the first path of Table4, from the perspective of frequency, if the first three functions of a fault path are “is_printable,” “include_symbol,” and “direct_tree,” then the next functions which are likely to be affected are “include_symbol,” “print_symbol,” “gnu_output_handler,” and so on. From the perspective of security features, the path displays higher rank and value in vulnerability, which indicates the fault location is relatively accurate. If it is a hostile attack detection, the attacker expects a wider range effect, so the propagation should be considered more. In this case, the analysis method is similar.


## 6.1. Runtime and Scalability Tests of SFFPS

By testing the runtime and scalability of SFFPS, two newest versions of each Cflow and Tar are selected. The support threshold is from 0.005 to 0.01 for runtime test, and the upper threshold 0.01 is used for scalability test. The total runtime is composed of three parts, node fault feature calculation, frequent pattern mining, and weight appending. Figure4 is the runtime test of SFFPS with different support thresholds and Figure 5 is the scalability test with different length percentages of the sequence when the support threshold is set to 0.01.Figure 4
Runtime test of SFFPS with different support thresholds.
(a)
Runtime test of SFFPS in Cflow (b)
Runtime test of SFFPS in TarFigure 5
Scalability test of SFFPS with different percentages of sequence length.
(a)
Scalability test of Cflow with minsup = 0.005 (b)
Scalability test of Cflow with minsup = 0.010 (c)
Scalability test of Tar with minsup = 0.005 (d)
Scalability test of Tar with minsup = 0.010From Figure4, SFFPS performs well in the support threshold range [0.005, 0.010]. This is due to the adjacency table which is for the storage of the complex network model. The calculation of the out-degree and in-degree of the nodes is made easier, which improves the calculation of node security feature. Furthermore, as the sequence model is based on the start order of each function, the detailed invocation and end time of a node are ignored, and the length of the sequence model is simplified. Also, position value index is used for the mining and pattern growth of the paths, which avoids candidate generation, and index methods are always effective. Finally, the weight appending process achieves efficiency because fewer nodes are involved by the strategy of nonrepetition.From Figure5, SFFPS shows good scalability on the software Cflow. With the increase of the length of the sequence, the execution time of SFFPS is essentially a linear growth. From the experimental data, the number of frequent sequences is also increasing. This indicates that the functions of Cflow are uniformly distributed. However, the time overhead of software Tar is quite expensive around 40% of sequence length; the number of frequent sequences increases rapidly from 194 when the percentage is 20% to 1123. After that, the time overhead and the number of frequent sequences reduces. This indicates that there are more core functions in software Tar and there are more invocations of core functions in the early stage of the program.


## 6.2. The Security Features of the Function Nodes

Tables2 and 3 show the security feature rank and value of the function nodes in the newest versions of Cflow and Tar.Table 2
Rank and value of function node security features in Cflow.
Vulnerability Propagation Function name Cflow-1.3 Cflow-1.4 Function name Cflow-1.3 Cflow-1.4 (rank/value) (rank/value) parse_variable_declaration 1/45.05 1/47.07 nexttoken 1/33.73 1/36.17 parse_declaration 2/40.77 2/41.85 tokpush 2/19.74 3/20.96 yyparse 3/37.50 4/38.82 putback 3/19.32 4/19.32 parse_typedef 4/19.33 6/20.78 get_token 4/17.86 5/19.08 tree_output 5/18.50 5/25.56 linked_list_append 5/15.47 2/21.06 func_body 6/18.15 7/18.28 lookup 6/13.79 6/13.94 parse_function_declaration 7/17.80 8/17.99 hash_symbol_hasher 7/12.90 8/13.04 parse_dcl 8/16.92 9/17.41 hash_symbol_compare 7/12.90 8/13.04 expression 9/16.17 10/16.42 yy_load_buffer_state 8/12.86 7/13.27 initializer_list 10/12.53 13/12.72 yylex 9/9.93 11/10.54Table 3
Rank and value of function node security features in Tar.
Vulnerability Propagation Function name Tar-1.27 Tar-1.28 Function name Tar-1.27 Tar-1.28 (rank/value) (rank/value) dump_file0 1/42.84 1/44.09 to_chars 1/17.28 1/17.28 create_archive 2/32.02 2/33.21 assign_string 2/11.67 2/11.67 dump_file 3/25.92 4/27.04 to_octal 3/9.64 3/9.64 dump_regular_file 4/19.37 5/19.37 tar_copy_str 4/7.13 4/7.13 dump_hard_link 5/17.37 6/17.37 set_next_block_after 5/6.64 5/6.64 start_header 6/15.62 8/15.62 find_next_block 6/6.16 6/6.16 dump_dir0 7/15.37 7/16.37 start_header 7/5.84 7/5.84 dump_dir 8/10.68 9/11.18 finish_header 7/5.84 7/5.84 close_archive 9/7.50 11/8.00 current_block_ordinal 7/5.84 7/5.84 _open_archive 10/7.25 10/8.75 flush_archive 8/5.83 8/5.83From Tables2 and 3, the security features of the same function nodes are relatively stable for different versions of the same software. So, in the process of version evolution, it can be inferred and predicted that the same function should have approximate rank in a new software version. Also, the function rank in the old version can be used as a basis for the version upgrade process with function nodes remove, merger, or update. The nodes with larger rank changes should be given more attention.Tables4 and 5 show the frequent paths of Cflow-1.4 in the top 10 security feature ranks of vulnerability and propagation.Table 4
Vulnerability rank and value of frequent paths(minsup=0.01).
Paths Rank/value is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 1/16.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 1/16.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 1/16.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/15.75 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/15.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/15.75 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 2/15.75 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol 3/14.75Table 5
Propagation rank and value of frequent paths(minsup=0.01).
Paths Rank/value is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 1/36.35 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 2/34.48 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 2/34.48 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 3/34.42 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 3/34.42 include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler, set_active 4/32.67 is_printable, include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name 5/32.60 direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 6/32.54 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline, gnu_output_handler 6/32.54 include_symbol, direct_tree, include_symbol, print_symbol, gnu_output_handler, print_symbol, print_level, print_function_name, newline 6/32.54There are double meanings of the paths listed in Tables4 and 5. One is that the paths are frequent, which first affirms that the occurrence possibility of the path is relatively large. The other one is that the security feature values of the paths are larger, which evaluates the security risk of the path. Only when both of them work together can we make a persuasive security measurement.In addition, the frequency of the path can be used to predict the function nodes that are going to be affected, and the security features of the path can be used to evaluate the possible impact scale of the abnormal path. For example, the main consideration of random fault detection is the vulnerability. According to the first path of Table4, from the perspective of frequency, if the first three functions of a fault path are “is_printable,” “include_symbol,” and “direct_tree,” then the next functions which are likely to be affected are “include_symbol,” “print_symbol,” “gnu_output_handler,” and so on. From the perspective of security features, the path displays higher rank and value in vulnerability, which indicates the fault location is relatively accurate. If it is a hostile attack detection, the attacker expects a wider range effect, so the propagation should be considered more. In this case, the analysis method is similar.


## 7. Conclusion

In this paper, a novel algorithm, SFFPS, is proposed to define and measure the security feature of dynamic execution path in software. Complex network model and sequence model are constructed for the record of invocation relationship and function execution order. The node degree in the complex network is used for security feature analysis from a structural perspective before real fault occurrence. The paths extracted from the sequence model are used for frequency test and weighted by the node security features. Finally, frequent dynamic execution paths with top security feature rank are mined as important paths which should be of greater concern. With the experiment, SFFPS can effectively mine the important paths from the newest versions of software programs Cflow and Tar. SFFPS can be applied as a basis for software evolution, a tool for software internal structure analysis, and a guidance to fault location and attack detection, which are helpful for software quality assurance.



---

*Source: 5716878-2018-03-22.xml*