CN117009994A - Code checking method and device and electronic equipment - Google Patents

Code checking method and device and electronic equipment Download PDF

Info

Publication number
CN117009994A
CN117009994A CN202310992467.8A CN202310992467A CN117009994A CN 117009994 A CN117009994 A CN 117009994A CN 202310992467 A CN202310992467 A CN 202310992467A CN 117009994 A CN117009994 A CN 117009994A
Authority
CN
China
Prior art keywords
code
information
module
checked
unsafe
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.)
Pending
Application number
CN202310992467.8A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310992467.8A priority Critical patent/CN117009994A/en
Publication of CN117009994A publication Critical patent/CN117009994A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Abstract

The application discloses a code checking method, a code checking device and electronic equipment, and belongs to the technical field of data processing. A code checking method comprising: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, M unsafe transmission links from a stain source to a convergence point are determined, and M is a positive integer; screening M unsafe transmission links according to at least one of code increment information of the code to be checked, historical vulnerability information of the code to be checked and module information of a target module in the code to be checked to obtain target unsafe transmission links; the target non-secure transfer link is output.

Description

Code checking method and device and electronic equipment
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a code checking method, a code checking device and electronic equipment.
Background
In the process of developing a large-scale system, the original code logic needs to be modified, and in the process, the problems of information safety, such as sensitive information leakage, improper authority control and the like, exist due to the fact that relevant codes are modified.
In order to reduce the occurrence of the above-mentioned situation, a smear analysis technique is proposed, in which the information flow security of a system is detected by analyzing whether data introduced by a smear source in a program can be directly propagated to a smear convergence point without being subjected to harmless treatment.
However, since the stain analysis technology has the problems of complex control flow, for a large system or application, thousands of stain transmission links are usually generated, and for each link, a large amount of manpower is required to perform investigation in order to determine information security, and the manpower cost is high.
Disclosure of Invention
The embodiment of the application aims to provide a code checking method, a code checking device and electronic equipment, which can solve the problem that a great deal of manpower is required for checking in order to determine information safety, and the manpower cost is high.
In a first aspect, an embodiment of the present application provides a code checking method, including: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, M unsafe transmission links from a stain source to a convergence point are determined, and M is a positive integer; screening M unsafe transmission links according to at least one of code increment information of the code to be checked, historical vulnerability information of the code to be checked and module information of a target module in the code to be checked to obtain target unsafe transmission links; the target non-secure transfer link is output.
In a second aspect, an embodiment of the present application provides a code checking apparatus, including: the scanning module is used for scanning the code to be inspected by adopting a stain analysis technology, determining M unsafe transmission links from a stain source to a convergence point, wherein M is a positive integer; the processing module is used for screening the M unsafe transmission links according to at least one of the code increment information of the code to be checked, the historical vulnerability information of the code to be checked and the module information of the target module in the code to be checked to obtain target unsafe transmission links; and the output module is used for outputting the target unsafe transmission link.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method as in the first aspect.
In a fifth aspect, embodiments of the present application provide a chip comprising a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to execute programs or instructions to implement a method as in the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement a method as in the first aspect.
In the embodiment of the application, one or more of code increment information of the code to be checked, historical vulnerability information of the code to be checked and module information of a target module in the code to be checked are used as screening conditions to screen M unsafe transmission links, so that a target unsafe transmission link is obtained through screening, and the target unsafe transmission link is output. Therefore, the number of transmission links needing manual investigation is reduced, the labor cost required by investigation is reduced while the information security is ensured, and the information security investigation cost is reduced.
Drawings
FIG. 1 is a schematic block diagram of a process of spot analysis in an embodiment of the application;
FIG. 2 is one of the schematic diagrams of the transfer links of a spot in an embodiment of the application;
FIG. 3 is a flow chart of a code checking method in an embodiment of the application;
FIG. 4 is a second schematic diagram of a transfer link for a smudge in an embodiment of the application;
FIG. 5 is a schematic block diagram of a code inspection apparatus in an embodiment of the present application;
FIG. 6 is a schematic block diagram of an electronic device in an embodiment of the application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device in an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described more fully hereinafter with reference to the accompanying drawings, in which it is shown, however, in which some, but not all embodiments of the application are shown. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The code checking method, the code checking device and the electronic equipment provided by the embodiment of the application are described in detail through specific embodiments and application scenes thereof by combining the attached drawings.
The stain analysis technology detects the information flow safety of the system by analyzing whether the data introduced by the stain source in the program can be directly transmitted to the stain converging point without harmless treatment.
Wherein, the stain analysis can be abstracted into a form of triples. Wherein source is a dirty point source, and represents directly introducing untrusted data or confidential data into the system; sink is a spot aggregation point, which represents directly generating security sensitive operation (violating data integrity) or revealing private data to the outside (violating data confidentiality); sanitizer is harmless treatment, and represents that data transmission does not harm the information security of a software system by means of data encryption or removal of hazard operation and the like.
The stain analysis is to analyze whether the data introduced by the stain source in the program can be directly transmitted to the stain converging point without innocent treatment, if not, the system is safe; otherwise, the system is described to generate security problems such as privacy data disclosure or dangerous data operation.
The processing process of the smear analysis can be divided into 3 stages, as shown in fig. 1, a smear source comprises a smear variable 1 and a smear variable 2, wherein the smear variable 1 consists of a variable 1 and a smear mark, the smear variable 1 is transmitted to a smear variable 3 through a smear, the smear variable 3 and the variable 4 form a smear variable 5, the smear variable 5 is transmitted to a smear variable 6, and the smear variable 6 is transmitted to a smear variable 10 in a smear point convergence point; and the stain variable 2 is transmitted to the stain variable 7 in the stain transmission process, the stain variable 7 is transmitted to the stain variable 8, and the stain variable 8 is subjected to innocent treatment to form a variable 9, and in the process, the stain variable 2 is subjected to innocent treatment in the stain transmission process, so that the stain mark is eliminated.
And the propagation process from the source of the smear to the point of the smear convergence can be understood as a transfer link in the present application.
As shown in fig. 2, the control flow of the transfer link of the stain includes: firstly, taking a function A1 of a component A as an entry, then calling a function B1 method of a component B to read data input by a user, then processing the data by a function B2 method of the component B, returning to the function A2 of the component A for data processing, and finally calling a function C1 of a component C for sensitive system call.
For the above-mentioned transfer link, it is necessary to manually check whether there is filtering or innocent treatment on the data transmitted by the user in the function B2 and the function A2, and only the required portion meeting the specific format is reserved.
For example, for an application download scenario for a browser module in a cell phone: the data entered by the user should be a legal uniform resource location system (uniform resource locator, URL) address to ultimately invoke the file download and storage interface.
In one embodiment, as shown in fig. 3, a code checking method is proposed, including:
and 302, scanning codes to be inspected by adopting a stain analysis technology, and determining M unsafe transmission links from a stain source to a convergence point, wherein M is a positive integer.
In this embodiment, the transfer link is not secure, i.e. it has not been subjected to innocuous treatment.
And step 304, screening the M unsafe transmission links according to at least one of the code increment information of the code to be checked, the historical vulnerability information of the code to be checked and the module information of the target module in the code to be checked to obtain the target unsafe transmission link.
Step 306, outputting the target non-secure transfer link.
In some embodiments of the application, the code delta information includes at least one of: modification time, modified file, code line scope, code segment, submitter information.
In this embodiment, when the code increment information includes the modification time, the modification time may be used to screen the code in the code to be inspected, so that in the process of determining the target non-secure transmission link, accurate screening of the target non-secure transmission link may be implemented, and further, the code amount required to be inspected is reduced, so as to reduce the inspection cost.
In some embodiments of the present application, the expression form of the modification time may be within one week, one month, or within half year, which may be selected according to the actual use requirement, and will not be described herein.
In some embodiments of the present application, the modified file, it is understood that the file in which the modified or added code is located, may include annotation information for interpreting the modified or added code, while containing the modified or added code.
In some embodiments of the present application, the code line range may be understood as the position of the modified or added code in the current open source code corresponding to the code to be checked.
Specifically, for example, the expression form of the code line range may be 5000 lines to 6000 lines.
In some embodiments of the present application, a code segment may be understood as a piece of code that may implement a function set by a user.
In some embodiments of the present application, the presenter information, it is understood that the information of the presenter of the code is modified or added. The submitter may be an author of the modified or added code, or may be a executor who is instead executing.
In some embodiments of the present application, the presenter information includes one of a name of the presenter and an employee identity unique code or a proprietary number of a job where the presenter is located, so that codes in the code to be inspected can be screened according to the presenter information, and further, in a process of determining the target non-secure transfer link, accurate screening of the target non-secure transfer link can be achieved, and further, the code amount required for inspection is reduced, so that the inspection cost is reduced.
In some embodiments of the present application, the historical vulnerability information may be understood as vulnerability information of the code to be checked in the process of historical iteration in the process of being developed.
In some embodiments of the present application, the historical vulnerability information may be reported and processed by a security white cap through a security emergency response center (Security Response Center, SRC) history; and/or security engineers find out vulnerability information statistics in a security test stage in the development process.
In some embodiments of the present application, each piece of vulnerability information in the historical vulnerability information is counted in the form of a module for its occurrence in order to screen the code in the code to be inspected based on the number of vulnerability occurrences. And in the process of determining the target non-secure transfer link, the accurate screening of the target non-secure transfer link can be realized, so that the code quantity required to be checked is reduced, and the checking cost is reduced.
In some embodiments of the application, each piece of vulnerability information in the historical vulnerability information is in the form of a module that counts the number of occurrences thereof at different degrees of influence.
The degree of influence includes severe, high and medium risk.
In some embodiments of the present application, the historical vulnerability information is associated with writer information of the code with the vulnerability, specifically, statistics of the historical vulnerability information are shown in table 1:
TABLE 1
In this embodiment, for a code writer, if security awareness is not strong, there is a problem with the code written by the history of the same person, and there is a greater possibility that there is a problem with the new code.
Therefore, historical vulnerability information such as the historical occurrence times of problems of a submitter, the occurrence times of problems of a historical module and the like can be used as screening of the unsafe transmission link, so that a basis is provided for dynamic processing of the code scanning full life cycle, and the credibility of the determined target unsafe transmission link is improved.
A module, i.e. a build, is understood to be a collection of program statements individually named and independently fulfilling a user selected function.
In the above embodiment, it is understood that the target module is a module containing a user specification that requires focused investigation.
In this embodiment, the target module may be selected according to the attention of the user, and in this process, the targeted screening may be implemented in the process of screening the unsafe transmission link, that is, the unsafe transmission link including the target module may be preferentially inspected, so as to improve the inspection efficiency. In the embodiment of the application, one or more of code increment information of the code to be checked, historical vulnerability information of the code to be checked and module information of a target module in the code to be checked are used as screening conditions to screen M unsafe transmission links, so that a target unsafe transmission link is obtained through screening, and the target unsafe transmission link is output.
In the process, after the code to be checked is scanned by using the stain analysis technology and the unsafe transmission links from the stain source to the convergence point are determined, the transmission links needing manual checking can be screened, so that the number of screened transmission links is reduced, the checking efficiency is improved while the information safety is ensured, the labor cost required by checking work is reduced, and the information safety checking cost is reduced.
In some embodiments of the present application, the M non-secure transfer links from the taint source to the sink point are the M non-secure transfer links from the taint source to the sink point in the data stream data in the code to be inspected.
In some embodiments of the present application, screening M non-secure transfer links according to at least one of code increment information of a code to be checked, historical vulnerability information of the code to be checked, and module information of a target module in the code to be checked, to obtain a target non-secure transfer link includes: evaluating each unsafe transmission link based on at least one of the code increment information, the historical vulnerability information and the module information to obtain a corresponding evaluation weight value; determining a weight accumulated value of each unsafe transmission link based on the evaluation weight value; and screening the M unsafe transfer links based on the weight accumulated value to obtain the target unsafe transfer link.
In this embodiment, each unsafe transfer link is evaluated by using at least one of code increment information, historical vulnerability information and module information so as to evaluate whether each unsafe transfer link is preferentially checked, and the weight accumulated value of each unsafe transfer link is counted so as to sort the M unsafe transfer links by using the weight accumulated value, so that the target unsafe transfer link is obtained through screening.
In this embodiment, the unsafe transmission link with the possible safety problem can be screened out, that is, the target unsafe transmission link is obtained by screening, and the investigation efficiency is improved and the investigation cost is reduced while the transmission link with the possible safety problem is examined in a short time.
For example, as shown in fig. 4, the unsecure transfer link involves 3 components A, B, C of modules 1 and 2.
Wherein the link primary control flow: firstly, taking a function A1 of a component A as an entry, then calling a function B1 method of a component B to read data input by a user, then processing the data by a function B2 method of the component B, returning to the function A2 of the component A for data processing, and finally calling a function C1 of a component C for sensitive system call.
The data flow corresponding to the link is: the data entered by the user is read in component B, marked as source because it can be controlled by the user, then processed in function B2 of component B and function A2 of component a, respectively, and finally passed to function C1 of component C for a sensitive system call, which can act as a sink.
If the function B2 of the component B and the function A2 of the component a do not verify the data input by the user but directly make call transfer, the content that an attacker can control is possibly executed when the function C1 of the component C makes a sensitive system call, thus causing a security problem.
According to the embodiment of the application, the unsafe transmission link is evaluated according to the code increment information, the historical vulnerability information and the module information, if a serious vulnerability appears in the history of the module 1, a first evaluation weight value is obtained through evaluation, a second evaluation weight value is obtained through evaluation when the module 2 is a target module, and a third evaluation weight value is obtained through evaluation when the function B2 is a recently added modification.
The weight accumulated value of the unsafe transmission link is the sum value of the first evaluation weight value, the second evaluation weight value and the third evaluation weight value, and the weight accumulated value of the unsafe transmission link is compared with the weight accumulated values of other unsafe transmission links based on the sum value, so that the target unsafe transmission link is obtained.
In some embodiments of the present application, the code delta information, the historical vulnerability information, and the module information mainly comprise weight variables as shown in table 2, wherein the weight variables are used to evaluate the non-secure transfer links.
TABLE 2
Wherein, high weight, low weight and medium weight are used to represent the evaluation weight value.
In some embodiments of the present application, code scanning is performed on a code to be inspected by using a stain analysis technology, and determining M unsafe transfer links from a stain source to a convergence point in a data stream includes: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, and N transmission links are determined, wherein N is a positive integer greater than or equal to M; and acquiring links of the N transfer links, of which the stain variables are not processed by the harmless processing function, and obtaining M unsafe transfer links.
In this embodiment, the innocent treatment screening is performed on the N transfer links, that is, the links of the stain variable that are not processed by the innocent treatment function are obtained, so that the innocent treatment transfer links are screened out, so that in the process of screening the target unsafe transfer links, analysis of the innocent treatment transfer links is not required. In the process, the number of the transmission links to be analyzed can be reduced, the time spent for analyzing the transmission links is shortened, and the data processing efficiency is improved.
In some embodiments of the application, the code checking method further comprises: obtaining a comparison result of the code to be checked and the initial code, and obtaining code increment information based on the comparison result; and/or analyzing the modified annotation positioned in the code to be checked to obtain code increment information; and/or analyzing the code submission log in the code to be checked to obtain the code increment information.
In this embodiment, during the development of the code to be inspected, the version of the code to be inspected is iterated continuously, and the corresponding codes are different, so that the determination of the modified or newly added code can be realized by comparing the code to be inspected with the initial code, thereby realizing the determination of the code increment information. In the process, the code increment of the code to be checked under the whole life cycle can be recorded, so that the accuracy of the determined target unsafe transfer link is improved.
In some embodiments of the present application, the code to be inspected is compared with the initial code at a preset period to obtain the code increment information.
In this embodiment, it is contemplated that during development of the code to be inspected, different development teams may require annotation of the modified or added code. Thus, the determination of the code delta information may be achieved by parsing the modification annotation to enable the determination of the modified or newly added code.
For example, the annotation of the code to be checked is:
1.//XXX_companyZhangSanadd for Somethingbegin;
2. modified code segment …;
3. modified code segment …;
4.//XXX_companyZhangSanadd for Somethingend;
in the annotation content after//, "ZhangSan" is variable content, and the rest is fixed content.
The code repository may be scanned at this time and when a code segment is found wrapped by comments as described above, the portion is deemed to belong to delta information, i.e., a "modified code segment …" may be determined to be a modified or newly added code.
In some embodiments of the present application, the code commit log, i.e., the commit log of the code.
And acquiring the earliest and latest submitting identification numbers (Identity document, ID) in the corresponding code branches according to the set starting time and ending time, tracing to the version identifications corresponding to the earliest and latest submitting two times, and acquiring the content of the change file according to the version identifications so as to realize the determination of the modified or newly added codes, thereby realizing the determination of the code increment information.
In some embodiments of the application, the target module comprises at least one of: a function module with a export function in the code to be checked; a module with a modified security check function exists in the code to be checked; the system call service in the code to be checked is modified.
In this embodiment, the goal module may be determined according to the importance of the development product, such as in the development of a mobile terminal operating system, with each mobile application as a module becoming an important component of the operating system.
The mobile application may include a weather application module, an alarm clock application module, a browser application module, and the like.
In some embodiments of the present application, the function module with the export function may be a component in the function module with the export function, for example, a browser module may provide components such as web browsing, application downloading, and the like for the outside.
In some embodiments of the present application, there is a module in which the security check function is modified, which may be understood as a modification of the security check function in the module, wherein the modification may be replacing the security check function or adjusting a parameter of the security check function.
Taking a browser module as an example, a web page may have privileged operations such as opening an application, and the web page with the privileged operations is usually protected by a website and a white list of domain names, that is, only a website with a specific domain name can perform the operations. The modification to the judgment logic of the domain name is the modification to the security check function.
Wherein the security check function needs to take care of the relevant check logic to avoid that the existence of relevant vulnerabilities is exploited by hackers.
For example, judge domain name: when a certain com is identified, only the end is used, and the domain name of the certain com is also considered as a white list, so that the investigation is needed.
In some embodiments of the present application, a module in which a system call service is modified in a code to be checked may be understood that the authority of the call service in the module is modified, and if the code logic of the call service modified is wrongly written, the code logic is easy to be utilized to maliciously install an application program.
Taking a browser module as an example, some scenarios may provide a service of downloading and calling a silent installation application program provided by a system, and if the service of the silent installation application program is modified, consider that the authority of calling the service in the module is modified, and need to be checked.
In some embodiments of the present application, outputting the target non-secure transfer link includes: outputting data information associated with the target non-secure transfer link; the data information comprises a data flow, a control flow and an evaluation weight value obtained by evaluating each target non-secure transfer link based on at least one of code increment information, historical vulnerability information and module information of the target non-secure transfer link.
In the embodiment, the data information associated with the target non-secure transmission link is output for reference by an inspector, so that the target non-secure transmission link is inspected, and in the process, the inspection accuracy can be improved.
In some embodiments of the present application, the data information associated with the target non-secure transfer link is shown in the form of table 3:
TABLE 3 Table 3
Wherein the weights are integrated, i.e. the weight integration values in this embodiment.
In some embodiments of the present application, the data information of the M non-secure transfer links is also shown in table 3, so that the inspector can sort the data information of the M non-secure transfer links according to the provided header as a screening and sorting condition, so as to facilitate the inspection of the inspector.
In some embodiments of the application, more detailed information may be presented by clicking on each record, the display including a link map as in FIG. 2, or one or more of a code segment, a problem specification, a solution.
In the embodiment, the inspector can screen and check according to the comprehensive weights and various weight indexes in the list, and judge, analyze and inspect whether the data in the stain transfer link is subjected to harmless treatment. For the examined taint transfer link, if no problem exists, the link can be marked according to the link characteristics, and the link is removed when the next taint analysis is performed, so that the workload of the link examination can be further reduced.
In some embodiments of the present application, embodiments of the present application may be applied to a sensitive information leakage scenario.
The scene is mainly used for identifying the application module to acquire the sensitive information of the mobile phone, such as: international mobile equipment identification (International Mobile Equipment Identity, IMEI), handset number, short message, address book information, and after being processed by means of non-de-identification, it is sent to server end through network, to other application or printed out through log.
Among other things, the spot source (source) of the spot analysis may specify these locations: and a user sensitive information acquisition function, such as one or more of IMEI numbers, mobile phone numbers and address books.
Among other things, the spot analysis convergence point (sink) can specify these locations: one or more of parameters of the request to the internet, log print data.
In some embodiments of the present application, embodiments of the present application may be applied to vulnerability discovery scenarios.
The scene is mainly used for identifying vulnerability information on the mobile terminal, and comprises unauthorized file reading and writing, system command execution, illegal privilege function calling and the like. The user mobile terminal may be illegally hacked.
Among other things, the spot source (source) of the spot analysis may specify these locations: android four-major components and Application lifecycle functions, functions bound to controls in xml files, such as one or more of onclick, databinding.
Among other things, the spot analysis convergence point (sink) can specify these locations: file read-write, command execution, privileged function call.
In some embodiments of the present application, the embodiments of the present application may be applied to a data transfer risk scenario between Android components.
The scene is mainly used for identifying the behavior of sensitive data transmission among different Android components on the mobile terminal, such as sending mobile phone numbers, address books and the like to other application modules.
Among other things, the spot source (source) of the spot analysis may specify these locations: and a user sensitive information acquisition function, such as one or more of IMEI numbers, mobile phone numbers and address books.
Among other things, the spot analysis convergence point (sink) can specify these locations: one or more of an Intent send function and a ContenProvider store function.
According to the code checking method provided by the embodiment of the application, the execution main body can be a code checking device. In the embodiment of the present application, a code inspection device is described by taking a code inspection device executing a code inspection method as an example.
In one embodiment, as shown in fig. 5, there is provided a code checking apparatus 500 comprising: the scanning module 502 is used for scanning codes to be inspected by adopting a stain analysis technology, determining M unsafe transmission links from a stain source to a convergence point, wherein M is a positive integer; the processing module 504 is configured to screen the M unsafe transfer links according to at least one of the code increment information, the historical vulnerability information, and the module information, so as to obtain a target unsafe transfer link; and an output module 506, configured to output the target insecure delivery link.
In the embodiment of the application, one or more of code increment information of the code to be checked, historical vulnerability information of the code to be checked and module information of a target module in the code to be checked are used as screening conditions to screen M unsafe transmission links, so that a target unsafe transmission link is obtained through screening, and the target unsafe transmission link is output.
In the process, after the code to be checked is scanned by using the stain analysis technology and the unsafe transmission links from the stain source to the convergence point are determined, the transmission links needing manual checking can be screened, so that the number of screened transmission links is reduced, the checking efficiency is improved while the information safety is ensured, the labor cost required by checking work is reduced, and the information safety checking cost is reduced.
In some embodiments of the application, the processing module 504 is configured to: evaluating each unsafe transmission link based on at least one of the code increment information, the historical vulnerability information and the module information to obtain a corresponding evaluation weight value; determining a weight accumulated value of each unsafe transmission link based on the evaluation weight value; and screening the M unsafe transfer links based on the weight accumulated value to obtain the target unsafe transfer link.
In this embodiment, each unsafe transfer link is evaluated by using at least one of code increment information, historical vulnerability information and module information so as to evaluate whether each unsafe transfer link is preferentially checked, and the weight accumulated value of each unsafe transfer link is counted so as to sort the M unsafe transfer links by using the weight accumulated value, so that the target unsafe transfer link is obtained through screening.
In this embodiment, the unsafe transmission link with the possible safety problem can be screened out, that is, the target unsafe transmission link is obtained by screening, and the investigation efficiency is improved and the investigation cost is reduced while the transmission link with the possible safety problem is examined in a short time.
In some embodiments of the present application, the scanning module 502 is configured to: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, and N transmission links are determined, wherein N is a positive integer greater than or equal to M; and acquiring links of the N transfer links, of which the stain variables are not processed by the harmless processing function, and obtaining M unsafe transfer links.
In this embodiment, the innocent treatment screening is performed on the N transfer links, that is, the links of the stain variable that are not processed by the innocent treatment function are obtained, so that the innocent treatment transfer links are screened out, so that in the process of screening the target unsafe transfer links, analysis of the innocent treatment transfer links is not required. In the process, the number of the transmission links to be analyzed can be reduced, the time spent for analyzing the transmission links is shortened, and the data processing efficiency is improved.
In some embodiments of the present application, the scanning module 502 is further configured to: obtaining a comparison result of the code to be checked and the initial code, and obtaining code increment information based on the comparison result; and/or analyzing the modified annotation positioned in the code to be checked to obtain code increment information; and/or analyzing the code submitting log of the code to be checked to obtain the code increment information.
In this embodiment, during the development of the code to be inspected, the version of the code to be inspected is iterated continuously, and the corresponding codes are different, so that the determination of the modified or newly added code can be realized by comparing the code to be inspected with the initial code, thereby realizing the determination of the code increment information. In the process, the code increment of the code to be checked under the whole life cycle can be recorded, so that the accuracy of the determined target unsafe transfer link is improved.
In some embodiments of the present application, the code to be inspected is compared with the initial code at a preset period to obtain the code increment information.
In this embodiment, it is contemplated that during development of the code to be inspected, different development teams may require annotation of the modified or added code. Thus, the determination of the code delta information may be achieved by parsing the modification annotation to enable the determination of the modified or newly added code.
In some embodiments of the present application, the code commit log, i.e., the commit log of the code.
And acquiring the earliest and latest commit IDs in the ending time in the corresponding code branches according to the set starting time and ending time, tracing to the version identifiers corresponding to the earliest commit and the latest commit twice, and acquiring the content of the change file according to the version identifiers so as to realize the determination of the modified or newly added codes, thereby realizing the determination of the code increment information.
In some embodiments of the application, the target module comprises at least one of: a function module with a export function in the code to be checked; a module with a modified security check function exists in the code to be checked; the system call service in the code to be checked is modified.
In some embodiments of the present application, the output module 506 is specifically configured to: outputting data information associated with the target non-secure transfer link; the data information comprises a data flow, a control flow and an evaluation weight value obtained by evaluating each target non-secure transfer link based on at least one of code increment information, historical vulnerability information and module information of the target non-secure transfer link.
In the embodiment, the data information associated with the target non-secure transmission link is output for reference by an inspector, so that the target non-secure transmission link is inspected, and in the process, the inspection accuracy can be improved.
The code checking device 500 in the embodiment of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The code checking device 500 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The code checking device 500 provided in the embodiment of the present application can implement each process implemented by the code checking method embodiment of fig. 3, and can achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
As shown in fig. 6, the embodiment of the present application further provides an electronic device 600, which includes a processor 602 and a memory 604, where the memory 604 stores a program or instructions that can be executed on the processor 602, and the program or instructions implement the steps of the above code checking method embodiment when executed by the processor 602, and achieve the same technical effects, so that repetition is avoided and redundant description is omitted.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
As shown in fig. 7, the electronic device 700 includes, but is not limited to: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 710 via a power management system so as to perform functions such as managing charge, discharge, and power consumption via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
In one embodiment, processor 710 is configured to: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, M unsafe transmission links from a stain source to a convergence point are determined, and M is a positive integer; screening the M unsafe transmission links according to at least one of the code increment information, the historical vulnerability information and the module information to obtain target unsafe transmission links; the target non-secure transfer link is output.
In one embodiment, the processor 710 is specifically configured to: evaluating each unsafe transmission link based on at least one of the code increment information, the historical vulnerability information and the module information to obtain a corresponding evaluation weight value; determining a weight accumulated value of each unsafe transmission link based on the evaluation weight value; and screening the M unsafe transfer links based on the weight accumulated value to obtain the target unsafe transfer link.
In one embodiment, the processor 710 is specifically configured to: code scanning is carried out on the code to be inspected by adopting a stain analysis technology, and N transmission links are determined, wherein N is a positive integer greater than or equal to M; and acquiring links of the N transfer links, of which the stain variables are not processed by the harmless processing function, and obtaining M unsafe transfer links.
In one embodiment, the processor 710 is specifically configured to: obtaining a comparison result of the code to be checked and the initial code, and obtaining code increment information based on the comparison result; and/or analyzing the modified annotation positioned in the code to be checked to obtain code increment information; and/or analyzing the code submission log in the code to be checked to obtain the code increment information.
In one embodiment, the target module includes at least one of: a function module with a export function in the code to be checked; a module with a modified security check function exists in the code to be checked; the system call service in the code to be checked is modified.
In one embodiment, the processor 710 is further configured to: outputting data information associated with the target non-secure transfer link;
the data information comprises a data flow, a control flow and an evaluation weight value obtained by evaluating each target non-secure transfer link based on at least one of code increment information, historical vulnerability information and module information of the target non-secure transfer link.
It should be appreciated that in embodiments of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, with the graphics processor 7041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts, a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 709 may include volatile memory or nonvolatile memory, or the memory 709 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 709 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, and the like, and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 710.
The embodiment of the application also provides a readable storage medium, and the readable storage medium stores a program or an instruction, which when executed by a processor, implements each process of the code checking method embodiment, and can achieve the same technical effect, so that repetition is avoided, and no further description is provided herein.
The processor is a processor in the electronic device in the above embodiment. Readable storage media include computer readable storage media such as computer readable memory ROM, random access memory RAM, magnetic or optical disks, and the like.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the code checking method embodiment can be realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the respective processes of the code checking method embodiments described above, and achieve the same technical effects, and are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the embodiments of the present application may be embodied in essence or contributing to the prior art in the form of a computer software product stored on a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a cell phone, computer, server, or network device, etc.) to perform the methods of the various embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (11)

1. A code checking method, comprising:
code scanning is carried out on the code to be inspected by adopting a stain analysis technology, M unsafe transmission links from a stain source to a convergence point are determined, and M is a positive integer;
screening M unsafe transmission links according to at least one of the code increment information of the code to be checked, the historical vulnerability information of the code to be checked and the module information of the target module in the code to be checked to obtain target unsafe transmission links;
outputting the target non-secure transfer link.
2. The code checking method according to claim 1, wherein said screening the M non-secure transfer links according to at least one of the code increment information of the code to be checked, the historical vulnerability information of the code to be checked, and the module information of the target module in the code to be checked to obtain the target non-secure transfer link includes:
evaluating each unsafe transmission link based on at least one of the code increment information, the historical vulnerability information and the module information to obtain a corresponding evaluation weight value;
determining a weight accumulation value of each unsafe transfer link based on the evaluation weight value;
And screening the M unsafe transmission links based on the weight accumulated value to obtain target unsafe transmission links.
3. The code inspection method according to claim 1, wherein the code scanning for the code to be inspected using the stain analysis technique determines M non-secure transfer links from the stain source to the convergence point, comprising:
code scanning is carried out on the code to be inspected by adopting a stain analysis technology, and N transmission links are determined, wherein N is a positive integer greater than or equal to M;
and acquiring links of the stain variable in the N transfer links which are not processed by the harmless processing function, and obtaining M unsafe transfer links.
4. A code checking method according to any one of claims 1 to 3, further comprising:
obtaining a comparison result of the code to be checked and the initial code, and obtaining the code increment information based on the comparison result; and/or
Analyzing the modification annotation in the code to be checked to obtain the code increment information; and/or
And analyzing the code submitting log of the code to be checked to obtain the code increment information.
5. A code checking method according to any one of claims 1 to 3, wherein the target module comprises at least one of:
The function module is provided with a deriving function in the code to be checked;
a module with a modified safety check function exists in the code to be checked;
and the system call service in the code to be checked is modified.
6. A code checking method according to any one of claims 1 to 3, wherein said outputting said target non-secure transfer link comprises:
outputting data information associated with the target non-secure transfer link;
the data information comprises a data flow and a control flow of the target non-secure transfer link, and an evaluation weight value obtained by evaluating each target non-secure transfer link based on at least one of the code increment information, the historical vulnerability information and the module information.
7. A code inspection apparatus, comprising:
the scanning module is used for scanning the code to be inspected by adopting a stain analysis technology, determining M unsafe transmission links from a stain source to a convergence point, wherein M is a positive integer;
the processing module is used for screening the M unsafe transmission links according to at least one of the code increment information of the code to be checked, the historical vulnerability information of the code to be checked and the module information of the target module in the code to be checked to obtain target unsafe transmission links;
And the output module is used for outputting the target unsafe transmission link.
8. The code checking device according to claim 7, wherein said processing module is specifically configured to:
evaluating each unsafe transmission link based on at least one of the code increment information, the historical vulnerability information and the module information to obtain a corresponding evaluation weight value;
determining a weight accumulation value of each unsafe transfer link based on the evaluation weight value;
and screening the M unsafe transmission links based on the weight accumulated value to obtain target unsafe transmission links.
9. The code checking device according to claim 7, wherein the scanning module is specifically configured to:
code scanning is carried out on the code to be inspected by adopting a stain analysis technology, and N transmission links are determined, wherein N is a positive integer greater than or equal to M;
and acquiring links of the stain variable in the N transfer links which are not processed by the harmless processing function, and obtaining M unsafe transfer links.
10. The code checking device according to any one of claims 7 to 9, wherein the output module is specifically configured to:
Outputting data information associated with the target non-secure transfer link;
the data information comprises a data flow and a control flow of the target non-secure transfer link, and an evaluation weight value obtained by evaluating each target non-secure transfer link based on at least one of the code increment information, the historical vulnerability information and the module information.
11. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method of any one of claims 1 to 6.
CN202310992467.8A 2023-08-08 2023-08-08 Code checking method and device and electronic equipment Pending CN117009994A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310992467.8A CN117009994A (en) 2023-08-08 2023-08-08 Code checking method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310992467.8A CN117009994A (en) 2023-08-08 2023-08-08 Code checking method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117009994A true CN117009994A (en) 2023-11-07

Family

ID=88570746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310992467.8A Pending CN117009994A (en) 2023-08-08 2023-08-08 Code checking method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117009994A (en)

Similar Documents

Publication Publication Date Title
Melicher et al. Riding out domsday: Towards detecting and preventing dom cross-site scripting
Snyder et al. Most websites don't need to vibrate: A cost-benefit approach to improving browser security
Shar et al. Defeating SQL injection
US8613080B2 (en) Assessment and analysis of software security flaws in virtual machines
TWI575397B (en) Point-wise protection of application using runtime agent and dynamic security analysis
CN112685737A (en) APP detection method, device, equipment and storage medium
US11861006B2 (en) High-confidence malware severity classification of reference file set
Casey et al. Malware forensics field guide for Linux systems: digital forensics field guides
WO2008103286A2 (en) Assessment and analysis of software security flaws
Calciati et al. Automatically granted permissions in Android apps: An empirical study on their prevalence and on the potential threats for privacy
Appelt et al. Assessing the impact of firewalls and database proxies on sql injection testing
Bergadano et al. A modular framework for mobile security analysis
Shahriar et al. OCL fault injection-based detection of LDAP query injection vulnerabilities
US9348977B1 (en) Detecting malware in content items
CN112446030B (en) Method and device for detecting file uploading vulnerability of webpage end
CN117009994A (en) Code checking method and device and electronic equipment
Du et al. An Empirical Analysis of Hazardous Uses of Android Shared Storage
Szczepanik et al. Security of mobile banking applications
Busch et al. Make Remote Forensic Investigations Forensic Again: Increasing the Evidential Value of Remote Forensic Investigations
Kumar Reverse Engineering and Vulnerability Analysis in Cyber Security.
Jansen et al. Guidelines on active content and mobile code
TW201947441A (en) Information security protection method
Fan et al. Analyzing application private information leaks with privacy Petri Net
US20230083977A1 (en) Method and apparatus for identifying a logic defect in an application
Khodayari et al. The Great Request Robbery: An Empirical Study of Client-side Request Hijacking Vulnerabilities on the Web

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