A Collaborative Review Method and System for Code Vulnerabilities Based on Evidence Gaps and Version Constraints
By establishing immutable audit snapshots and dependency indexes, the problems of erroneous conclusions and resource waste caused by version mismatches in multi-tool collaborative review are solved, enabling efficient and accurate review of code vulnerabilities.
Patent Information
- Application Number
- CN202611628591.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies lack a unified evidence version management mechanism when analyzing code asynchronously using multiple tools. This leads to the incorrect use of security verification information from older versions to exclude current risks, resulting in duplicate analysis and wasted resources. Furthermore, it is impossible to accurately locate the affected conclusions for local updates.
By establishing immutable audit snapshots, version-constrained evidence admission and local incremental re-judgment of dependencies are achieved, enabling version consistency verification and local incremental re-judgment of evidence data, generating structured supplementary evidence analysis tasks, and using dependency indexes for precise location and local evaluation.
It improves the accuracy and efficiency of vulnerability review, reduces computational resource consumption, and ensures the logical consistency of review conclusions and the stability of system status.
Smart Images

Figure CN123116296A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer security and software testing technology, specifically to a collaborative review method and system for code vulnerabilities based on evidence gaps and version constraints. Background Technology
[0002] In the field of code security auditing, static analysis tools and semantic analysis models are typically used in conjunction to identify potential vulnerabilities. However, when multiple tools asynchronously analyze the same code object, existing technologies often lack a unified evidence version management mechanism. Different scan branches or historical logs may correspond to different code or configuration versions. If results are merged only by filename and line number, it is easy for security verification information from older versions to be incorrectly used to exclude current risks, leading to erroneous definitive conclusions. Furthermore, when insufficient evidence is found during the review process, existing schedulers struggle to determine specific supplementary evidence targets and boundaries, easily triggering repeated readings of irrelevant code and model inferences, resulting in inefficient consumption of computing resources. Moreover, when evidence changes, the entire audit process usually needs to be rerun, making it impossible to accurately locate the affected conclusions for local updates, further exacerbating resource overhead and low review efficiency. Summary of the Invention
[0003] To address the problems of erroneous definitive conclusions and excessive computational resource consumption caused by evidence version mismatch and duplicate analysis in existing technologies, this application proposes a collaborative code vulnerability review method and system based on evidence gaps and version constraints. This method enables evidence admission based on version constraints and local incremental re-judgment based on dependencies, thereby improving the accuracy and efficiency of vulnerability review.
[0004] To achieve the above objectives, this application adopts the following technical solution: A collaborative code vulnerability review method includes: acquiring target code and associated configuration information to establish an audit snapshot containing resource version information, and acquiring candidate vulnerability objects through at least two independent scanning paths; the audit snapshot remains unchanged during a single review; creating evidence condition objects for candidate propagation paths of the candidate vulnerability objects, the evidence condition objects including propositions to be verified; performing version consistency verification on analytical evidence data associated with the evidence condition objects based on the resource version information in the audit snapshot, and evaluating the propositions to be verified based on the verification results to determine a condition state; generating evidence gap records and supplementary evidence analysis tasks with query ranges in response to the condition state being unclosed; executing the supplementary evidence analysis tasks to acquire new evidence data, and re-evaluating the affected evidence condition objects and the vulnerability review conclusions based on the dependency index between the analytical evidence data, the evidence condition objects, and the vulnerability review conclusions; and outputting the vulnerability review conclusions based on the re-evaluated condition states.
[0005] Preferably, the at least two independent scanning paths include a static rule scanning path and an independent semantic scanning path; the independent semantic scanning path does not require the output of the static rule scanning path as a necessary input; the acquisition of candidate vulnerability objects includes: taking the union of the output results of the static rule scanning path and the independent semantic scanning path, and establishing a traceable association; wherein, the failure of either path does not constitute proof against the candidate discovered by the other path.
[0006] Preferably, the step of evaluating the proposition to be verified based on the verification result to determine the conditional state includes: based on the version consistency verification, selecting valid evidence data applicable to the audit snapshot from the analyzed evidence data; determining the conditional state according to the following rules based on the positive evidence data and negative evidence data included in the valid evidence data: wherein the conditional state includes a support state, a negation state, an unknown state, and a conflicting state; when the positive evidence data exists and the negative evidence data does not exist, the conditional state is determined to be the support state; when the negative evidence data exists and the positive evidence data does not exist, the conditional state is determined to be the negation state; when both the positive evidence data and the negative evidence data exist simultaneously, the conditional state is determined to be the conflicting state; the unclosed state includes the unknown state and the conflicting state.
[0007] Preferably, when the conditional state is the conflict state, the method further includes: extracting the assumptions or configuration parameters of the positive evidence data and the negative evidence data that cause the conflict; splitting the candidate propagation path into multiple conditional branches based on the differences in the assumptions or configuration parameters; and redetermining the conditional state for each conditional branch based on the corresponding valid evidence data.
[0008] Preferably, the step of filtering valid evidence data applicable to the audit snapshot from the analytical evidence data based on the version consistency check includes: performing a resource location check on the analytical evidence data to verify whether the code resource pointed to by the analytical evidence data exists in the target code; performing a content digest matching check on the analytical evidence data to verify whether the content digest of the analytical evidence data is consistent with the current digest of the corresponding code resource in the audit snapshot; performing an applicability check on the analytical evidence data to verify whether the configuration scope of the analytical evidence data covers the candidate propagation path; and determining the analytical evidence data that simultaneously passes the resource location check, the content digest matching check, and the applicability check as the valid evidence data.
[0009] Preferably, the step of generating an evidence gap record and a supplementary evidence analysis task with a query range in response to the conditional state being unclosed includes: generating the evidence gap record in response to the conditional state being unclosed, the evidence gap record including a target resource identifier, a gap type, and a required evidence type; querying a preset task template library to obtain a target supplementary evidence template matching the gap type; determining the execution tool, query range, and output verification rules based on the target supplementary evidence template, the target resource identifier, and the required evidence type; and generating the supplementary evidence analysis task based on the execution tool, the query range, and the output verification rules.
[0010] Preferably, the gap types include unknown input source, missing propagation edge, unknown protection effectiveness, and unknown path conditions. When the gap type is the unknown input source type, the execution tool is configured to perform reverse data tracing with the input parameters or variables as anchor points, and the output verification rules require the output of source files, variable mappings, and controllable input conditions. When the gap type is the missing propagation edge type, the execution tool is configured to query the actual parameters, formal parameters, or return value relationships of a specified call point, and the output verification rules require the output of call edge source, alias processing, and analysis scope. When the gap type is the unknown protection effectiveness type, the execution tool is configured to read the verification function and its call conditions to verify the target and blocking semantics, and the output verification rules require the output of protection location, target object, branch, and configuration conditions. When the gap type is the unknown path conditions type, the execution tool is configured to extract path branch conditions and perform constraint checks or isolation verification, and the output verification rules require the output of evidence that the witness condition is satisfied or not satisfied.
[0011] Preferably, the step of re-evaluating the affected evidence condition object and the vulnerability review conclusion based on the dependency index between the analyzed evidence data, the evidence condition object, and the vulnerability review conclusion includes: generating the dependency index, which includes a first mapping from the target code to the analyzed evidence data, a second mapping from the analyzed evidence data to the evidence condition object, and a third mapping from the evidence condition object to the vulnerability review conclusion; responding to the added evidence data causing the analyzed evidence data to become invalid or change its state, locating the affected evidence condition object and the vulnerability review conclusion based on the first mapping, the second mapping, and the third mapping; and performing re-evaluation only on the located evidence condition object and the vulnerability review conclusion, while keeping the state of the unaffected evidence condition object and the vulnerability review conclusion unchanged.
[0012] Furthermore, this application also provides a code vulnerability collaborative review device, comprising: an audit snapshot module, used to acquire target code and associated configuration information to establish an audit snapshot containing resource version information, and to acquire candidate vulnerability objects through at least two independent scanning paths; the audit snapshot remains unchanged during a single review process; a condition creation module, used to create evidence condition objects for the candidate propagation paths of the candidate vulnerability objects, the evidence condition objects including propositions to be verified; a state evaluation module, used to perform version consistency verification on the analysis evidence data associated with the evidence condition objects based on the resource version information in the audit snapshot, and evaluate the propositions to be verified based on the verification results to determine the condition state; a supplementary evidence orchestration module, used to generate evidence gap records and supplementary evidence analysis tasks with query range in response to the condition state being unclosed; a local re-judgment module, used to execute the supplementary evidence analysis tasks to acquire new evidence data, and to re-evaluate the affected evidence condition objects and the vulnerability review conclusions based on the dependency index between the analysis evidence data, the evidence condition objects, and the vulnerability review conclusions; and a conclusion output module, used to output the vulnerability review conclusions based on the re-evaluated condition states.
[0013] In addition, this application also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the code vulnerability collaborative review method as described above.
[0014] Beneficial effects: This application establishes an immutable audit snapshot containing resource version information and instantiates vulnerability establishment requirements as evidence condition objects. This ensures that all analytical evidence data must undergo version consistency verification before participating in proposition evaluation, thus preventing historical versions or incompatible configurations from interfering with the current vulnerability determination and ensuring the logical consistency of the review conclusion. At the same time, by constructing a dependency index between analytical evidence data, evidence condition objects, and vulnerability review conclusions, when new evidence data is acquired or the evidence status changes, the index can be used to accurately locate and re-evaluate only the affected local objects. This avoids triggering a full-process recalculation due to a single evidence change, significantly reducing the computational resource consumption and time cost in the multi-tool collaborative audit process.
[0015] Furthermore, this application subdivides conditional states into four categories: support, denial, unknown, and conflict. For unclosed states, it generates structured supplementary evidence analysis tasks containing target resource identifiers, gap types, and query scope, transforming the ambiguous "insufficient evidence" into executable targeted verification actions. This avoids the waste of resources caused by blind global scanning or boundless model reasoning. In particular, the application introduces a conditional branching mechanism for conflict states and implements multi-dimensional verification of evidence admission, including resource positioning, content summary matching, and scope of application, further improving the granularity and accuracy of vulnerability determination in complex scenarios.
[0016] Furthermore, this application standardizes and automates the mapping of supplementary evidence tasks by defining specific gap types such as unknown input source, missing propagation edge, unknown protection effectiveness, and unknown path conditions, as well as their corresponding execution tools and output verification rules, ensuring the reliability and verifiability of the supplementary analysis results. Combined with the multi-layer mapping structure in the dependency index, the review process has complete traceability, which facilitates rapid response and maintains the stability of the system state when evidence becomes invalid or the environment changes. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the collaborative review method for code vulnerabilities in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0020] Example 1: As Figure 1 As shown, this application provides a collaborative code vulnerability review method based on evidence gaps and version constraints. This method achieves accurate vulnerability identification and incremental review in a multi-tool collaborative environment by constructing immutable audit benchmarks and a structured evidence condition model. The method includes the following steps: Step S1: Obtain the target code and associated configuration information to establish an audit snapshot containing resource version information, and obtain candidate vulnerability objects through at least two independent scanning paths; the audit snapshot remains unchanged during a single review.
[0021] An audit snapshot serves as the timeline and factual boundary for this review. It records not only the file list and content summary of the source code but also build dependency versions, deployment configuration snapshots, and analysis strategy versions. "Maintaining the status quo" means that throughout the entire review lifecycle of this snapshot, even if new commits are made to the code repository or configurations change, the system will not modify the current snapshot object in place. Instead, it will create an independent next-round snapshot for the new changes, ensuring that all evidence evaluations are based on the same definite factual foundation and avoiding logical errors caused by version drift. For example, when auditing a power metering data query service, the system first freezes specific code versions and related database connection configurations for the MeterController entry point, the QueryService service layer, and the MeterRepository data access layer, forming audit snapshot A. Subsequently, the system initiates a static rule scanning path and an independent semantic scanning path in parallel. The former identifies injection risks at database execution points based on a preset rule base, while the latter points out potential input constraint assumptions in the service layer based on semantic understanding. The union of the outputs of the two paths forms a set of candidate vulnerability objects, and the failure of either path to find a vulnerability does not constitute evidence against the other path's discovery of a candidate vulnerability, thus ensuring the recall and independence of the initial clue discovery.
[0022] Step S2: Create evidence condition objects for the candidate propagation paths of the candidate vulnerability objects. The evidence condition objects include propositions to be verified.
[0023] In this step, the system transforms abstract vulnerability types into a concrete, verifiable set of logical propositions. Evidence condition objects are not simple text descriptions, but structured data entities that explicitly define the necessary conditions that must be met to verify the vulnerability. Taking the aforementioned cross-function SQL injection candidate as an example, the system instantiates five core evidence condition objects for the candidate's propagation path based on a pre-defined injection vulnerability template: Q1 The target input can be controlled by an untrusted entity; Q2 The target data propagates along the specified path to the sensitive operation; Q3 The sink executes a sensitive operation belonging to this vulnerability type; Q4 The triggering conditions of the specified path can be met under the current snapshot constraints; and Q5 There is unprotected propagation along this path. Each condition object is bound to the proposition to be verified, the verifier type, and the initial state, giving subsequent automated analysis a clear target rather than blindly conducting a full code review.
[0024] Next, based on the resource version information in the audit snapshot, version consistency checks are performed on the analytical evidence data associated with the evidence condition object, and the condition state is determined based on the check results to evaluate the proposition to be verified.
[0025] The system does not directly accept analytical evidence from any source, but first verifies whether it applies to the current audit snapshot. Verification dimensions include, but are not limited to: whether the code resource pointed to by the evidence exists in the current snapshot, whether the content summary of the evidence matches the current resource, and whether the configuration scope of the evidence covers the current candidate path. Only evidence that passes all verifications is considered valid and participates in proposition evaluation. For example, if a historical log shows "QueryService.prepare function has enabled parameter filtering," but its corresponding code summary is inconsistent with the prepare function summary in the current audit snapshot A, then this evidence will be isolated and will not be used to determine Q5 as a negative state. Based on valid evidence, the system divides conditional states into four categories: supportive, negative, unknown, and conflicting. Supportive states exist when there is positive evidence and no negative evidence; negative states exist when there is neither; and conflicting states exist when both have the same scope of application. This fine-grained state management mechanism ensures that only facts verified through version alignment can affect vulnerability determination.
[0026] Step S3: In response to the condition being in an unclosed state, generate evidence gap records and supplementary evidence analysis tasks with query range.
[0027] An unclosed state includes both unknown and conflicting states, indicating that the current evidence is insufficient to draw a definitive conclusion. In this case, instead of simply marking it as awaiting manual review, the system automatically transforms the ambiguous evidence deficiency into a structured evidence gap record. This record details the target resource identifier, gap type, and required evidence type. Further, the system queries a pre-defined task template library, matches a dedicated supplementary evidence template for the gap, and generates a supplementary evidence analysis task with a clearly defined query scope. For example, in the above case, after initial evaluation, Q2 is found to be in an unknown state because the static analysis failed to trace the parameter flow across function boundaries. The system then generates a gap record of the propagation edge missing type and creates a targeted supplementary evidence task. This task is limited to querying only the actual and formal parameter mapping relationship between QueryService.prepare and MeterRepository.find, and the query depth does not exceed a preset threshold. This bounded design effectively prevents the supplementary evidence process from evolving into an unlimited global code search, significantly reducing computational overhead.
[0028] Step S4: Perform supplementary evidence analysis to obtain new evidence data, and re-evaluate the affected evidence condition objects and vulnerability review conclusions based on the dependency index between the analyzed evidence data, evidence condition objects, and vulnerability review conclusions.
[0029] After performing the supplementary evidence task, the system appends the newly acquired evidence data to the evidence set and triggers a local re-evaluation mechanism. The core of this mechanism lies in the dependency index, which pre-establishes a three-layer reverse mapping link from the target code to the analysis evidence, from the analysis evidence to the evidence conditions, and from the evidence conditions to the vulnerability review conclusion. When new evidence arrives or old evidence becomes invalid, the system does not need to rerun the entire audit process. Instead, it precisely locates the directly affected evidence condition object and its downstream review conclusions along the index, re-evaluating only these nodes while keeping the state of other unaffected nodes unchanged. Continuing with the previous example, when the supplementary evidence task successfully parses the return value of the prepare function and confirms that it is indeed passed as the SQL concatenation parameter to the find function, the system only updates the state of Q2 to support and re-evaluates the candidate path conclusions containing Q2. For Q1 and Q3, which have already been confirmed as supported, since their dependent evidence has not changed, the system directly reuses their original state, avoiding the computational waste of repeatedly parsing the entry function and database interface. This incremental update mechanism can bring orders of magnitude performance improvements when dealing with large-scale codebases or multiple rounds of iterative reviews.
[0030] Step S5: Output the vulnerability review conclusion based on the re-evaluated conditional state.
[0031] The final conclusion output strictly follows the closed-loop logic of evidentiary conditions. Only when all necessary evidentiary conditions on at least one candidate propagation path are supported, and there are no unresolved conflicts affecting that path, will the system output a confirmatory vulnerability review conclusion, specifying the version of evidence and the applicable assumptions bound to that conclusion. If a necessary condition is denied, the path is excluded; if conditions remain unclosed, the system outputs a status requiring supplementary evidence or manual review, retaining specific gap information for subsequent processing. For example, in the SQL injection case above, if Q1 to Q5 are ultimately supported and their versions are consistent, the system outputs "SQL injection risk confirmed under audit snapshot A constraints"; if Q4 remains unknown due to the inability to model external call semantics, the system outputs "Suspected risk, path reachability to be verified," rather than forcibly giving a high-confidence false positive conclusion. This rigorous output strategy ensures the reliability of the detection results and provides clear review guidance for human experts, avoiding erroneous definitive judgments due to incomplete information.
[0032] It should be understood that although this embodiment uses cross-function SQL injection as an example, this method is also applicable to other types of code security auditing scenarios such as unauthorized access, sensitive data leakage, and command injection; simply replace the corresponding evidence condition template and supplementary evidence task strategy. Furthermore, Figure 1The execution order of each step can be adjusted or executed in parallel according to the dependencies in actual implementation. As long as it does not violate the overall logical concept of first establishing a snapshot benchmark, then creating conditions, and finally supplementing evidence and re-judging, it should be covered within the protection scope of this application.
[0033] Example 2: Building upon Example 1, this example further details the acquisition method of candidate vulnerability objects and the state evaluation mechanism of evidence condition objects. In some embodiments, at least two independent scanning paths include a static rule scanning path and an independent semantic scanning path; the independent semantic scanning path does not require the output of the static rule scanning path as a necessary input; acquiring candidate vulnerability objects includes: taking the union of the outputs of the static rule scanning path and the independent semantic scanning path, and establishing a traceable association; wherein, a failure of either path does not constitute counter-evidence against the candidate discovered by the other path. The static rule scanning path is usually based on predefined syntax patterns or data flow rules for matching, which has high accuracy but is limited by the rule coverage; while the independent semantic scanning path is based on the understanding of code semantics, contextual logic, and security knowledge for analysis, and its initiation and execution are completely independent of the alert list of static rules, without using the static scanning results as a pre-filtering condition or necessary input. This parallel and independent design ensures that even if the static rules are not hit due to variant syntax or new attack patterns, the semantic scan can still discover potential risks based on behavioral characteristics. During the results merging phase, the system takes the union of the two outputs instead of their intersection and retains the original source identifier for each candidate vulnerability object, thus establishing a complete and traceable association. This means that if a candidate is only discovered by semantic scanning and not matched by static rules, the system will still consider it a valid candidate and proceed to the subsequent review process, and will never automatically exclude the risk due to the silence of static paths. This mechanism effectively overcomes the blind spots of single analysis tools and significantly improves the recall rate and robustness of vulnerability clue discovery.
[0034] After obtaining candidate vulnerability objects, the associated evidence must be rigorously screened. Based on version consistency verification, valid evidence data applicable to the audit snapshot is selected from the analytical evidence data. This includes: performing resource location verification on the analytical evidence data to verify whether the code resource pointed to by the analytical evidence data exists in the target code; performing content digest matching verification on the analytical evidence data to verify whether the content digest of the analytical evidence data is consistent with the current digest of the corresponding code resource in the audit snapshot; and performing scope verification on the analytical evidence data to verify whether the configuration scope of the analytical evidence data covers the candidate propagation path. Analytical evidence data that passes resource location verification, content digest matching verification, and scope verification simultaneously is determined to be valid evidence data. Resource location verification is used to exclude outdated evidence that references deleted files, renamed functions, or out-of-bounds line numbers, ensuring that all evidence can be anchored to the real entity in the current audit snapshot. Content digest matching verification further verifies whether the code content on which the evidence is based has changed. For example, even if the file name and line number have not changed, if the internal logic of the function body has been modified, the analysis conclusion generated based on the old logic will be deemed invalid, preventing the use of past correctness to prove current security. Scope verification focuses on the contextual validity of evidence. For example, evidence stating "permission verification is enabled" may only be valid in a specific deployment configuration or tenant mode. If the current candidate propagation path is outside the scope of that configuration, the evidence cannot be used to deny the vulnerability. Only evidence that simultaneously meets these three constraints will be marked as valid evidence data and participate in subsequent proposition evaluation, thereby fundamentally eliminating the risk of misjudgment caused by version drift, code refactoring, or environmental differences.
[0035] The conditional state is determined by evaluating the proposition to be verified based on the verification results. This includes: filtering valid evidence data applicable to the audit snapshot from the analytical evidence data based on version consistency verification; determining the conditional state according to the following rules based on the positive and negative evidence data contained in the valid evidence data: where the conditional state includes a supporting state, a disproving state, an unknown state, and a conflicting state; when positive evidence data exists and negative evidence data does not exist, the conditional state is determined to be a supporting state; when negative evidence data exists and positive evidence data does not exist, the conditional state is determined to be a disproving state; when both positive and negative evidence data exist, the conditional state is determined to be a conflicting state; unclosed states include unknown states and conflicting states. This state determination logic transforms discrete, potentially contradictory evidence fragments into structured state machine signals. Positive evidence data refers to procedural facts or analytical conclusions that can confirm the validity of the proposition to be verified, such as confirming that user input is directly concatenated into an SQL statement; negative evidence data refers to facts that can disprove the proposition, such as confirming that the input has undergone strict parameterized binding processing. The system does not employ simple majority voting or confidence-weighted methods, but rather makes definitive judgments based on the existence and mutual exclusivity of evidence. In particular, conflicting and unknown states are categorized together as unclosed states, meaning that as long as there are irreconcilable contradictions or missing information, the system will not rashly output a definitive conclusion, but will instead use it as a clear signal to trigger subsequent supplementary evidence tasks, thereby ensuring the rigor and conservatism of the review process.
[0036] To address potential evidence inconsistencies, when the conditional state is in a conflict state, the method further includes: extracting the assumptions or configuration parameters of the positive and negative evidence data that caused the conflict; splitting the candidate propagation path into multiple conditional branches based on the differences in the assumptions or configuration parameters; and re-determining the conditional state for each conditional branch based on the corresponding valid evidence data. In actual auditing scenarios, evidence conflicts are often not true logical paradoxes, but rather stem from different operating environments or configuration premises. For example, when reviewing a work order query interface for a smart agent, a log from the development environment shows that "the checkPermission function was executed and returned permission," constituting positive evidence supporting unauthorized access; while another configuration audit report from the production environment shows that "the permission verification switch for this interface has been turned off," constituting negative evidence that the protection is effective. In this case, the system will not simply determine that the evidence is insufficient or the risk is uncertain, but will automatically extract the configuration differences behind the two pieces of evidence and split the original candidate propagation path into two independent conditional branches: the development environment branch and the production environment branch. Subsequently, within each branch, the system will only use valid evidence data that matches the assumption of that branch to re-evaluate. In the example above, the development environment branch might be deemed secure due to valid verification, while the production environment branch might be deemed risky due to missing verification. This branch splitting mechanism based on difference analysis not only resolves apparent conflicts of evidence but also ensures that the review conclusions accurately reflect the true security status under different deployment scenarios. It avoids false positives or false negatives caused by general merging, greatly improving the granularity and business adaptability of vulnerability assessment.
[0037] Example 3: Building upon Examples 1 and 2, this example further details the generation mechanism of the supplementary evidence analysis task and the dependency-based local re-judgment logic. In response to an unclosed conditional state, an evidence gap record and a supplementary evidence analysis task with a query scope are generated, including: generating an evidence gap record, which includes a target resource identifier, gap type, and required evidence type; querying a pre-set task template library to obtain a target supplementary evidence template matching the gap type; determining the execution tool, query scope, and output verification rules based on the target supplementary evidence template, target resource identifier, and required evidence type; and generating the supplementary evidence analysis task based on the execution tool, query scope, and output verification rules. This mechanism transforms the abstract concept of insufficient evidence into a standardized, computer-executable work unit. The evidence gap record is not a simple text log but a structured data object that clearly indicates the specific location of the verification failure, the nature of the missing information, and the desired data format. The task template library pre-configures various validated analysis strategies, each defining best practices for a specific gap. The supplementary evidence analysis task generated through template matching has strict boundedness and directionality: the query scope limits the scope of the analysis tool or model retrieval code, preventing the analysis process from degenerating into a full-warehouse scan; the output verification rules define the structural constraints that valid evidence must meet, ensuring that the returned results can be directly consumed by subsequent condition evaluation modules, rather than unstructured text requiring secondary manual interpretation. This design fundamentally solves the problems of resource waste and unreliable results caused by the ambiguity of the supplementary evidence target in traditional automated auditing.
[0038] Furthermore, to cover common evidence gap scenarios in code auditing, the gap types include those with unknown input sources, missing propagation edges, unknown protection effectiveness, and unknown path conditions. For each type of gap, the system is configured with differentiated execution strategies to ensure the accuracy of supplementary evidence collection. When the gap type is "Input Source Unknown," the execution tool is configured to perform reverse data tracing using input parameters or variables as anchors. Output verification rules require the output of source files, variable mappings, and controllable input conditions to confirm the true external source of sensitive data. When the gap type is "Propagation Edge Missing," the execution tool is configured to query the relationship between actual parameters, formal parameters, or return values at a specified call point. Output verification rules require the output of call edge sources, alias processing, and analysis scope, aiming to resolve the issue of cross-function data flow breaks. When the gap type is "Protection Effectiveness Unknown," the execution tool is configured to read the verification function and its call conditions to verify the target and blocking semantics. Output verification rules require the output of protection location, target object, branches, and configuration conditions to distinguish the essential difference between the existence of protection code and the actual effectiveness of protection. When the gap type is "Path Condition Unknown," the execution tool is configured to extract path branch conditions and perform constraint checks or isolation verification. Output verification rules require the output of evidence that the condition is met or not met, used to determine the reachability of a specific vulnerability triggering path under the current snapshot constraints.
[0039] After performing supplementary evidence analysis and acquiring new evidence data, the system employs an incremental update strategy to avoid the overhead of global recalculation. Based on the dependency index between the analyzed evidence data, evidence condition objects, and vulnerability review conclusions, the affected evidence condition objects and vulnerability review conclusions are re-evaluated. This includes: generating a dependency index, which includes a first mapping from the target code to the analyzed evidence data, a second mapping from the analyzed evidence data to the evidence condition objects, and a third mapping from the evidence condition objects to the vulnerability review conclusions; responding to the invalidation or state change of the analyzed evidence data due to the addition of new evidence data, locating the affected evidence condition objects and vulnerability review conclusions based on the first, second, and third mappings; and re-evaluating only the located evidence condition objects and vulnerability review conclusions, while keeping the state of the unaffected evidence condition objects and vulnerability review conclusions unchanged. This dependency index constitutes the system's neural transmission network, enabling evidence changes to be precisely transmitted to relevant decision nodes like nerve impulses, rather than triggering a systemic stress response. The first mapping records the evidence data supported by the code entity; the second mapping records the judgment of the proposition to be verified in which the evidence data participates; and the third mapping records the final review conclusion determined by the combination of condition states. When new evidence arrives or old evidence becomes invalid due to version verification failure, the system first finds the directly related evidence entries through the first mapping, then traces upwards along the second mapping to the condition objects that depend on these evidences, and finally locates the affected review conclusions through the third mapping. Only nodes on this transmission chain are marked as pending re-judgment and trigger re-evaluation logic, while other conditions and conclusions that have no dependency on this evidence remain in their original state without any calculation. For example, in the cross-function SQL injection case mentioned in Example 1, when the supplementary evidence task for Q2 successfully returns the parameter mapping evidence from QueryService.prepare to MeterRepository.find, the system only updates the status of Q2 to supported and re-evaluates the candidate path conclusions containing Q2; while for Q1 and Q3, which have already been confirmed as supported, since their dependent evidence sources have not changed, the system directly reuses their historical evaluation results. In contrast, if the traditional global re-run mode is adopted, the static analysis and model inference of the entire codebase must be re-executed after each supplementary verification, and the computational overhead increases linearly or even exponentially with the code size. However, the local re-judgment mechanism of this application reduces the computational complexity to be only related to the size of the local subgraph of the affected node, which can bring significant performance improvement and resource saving when dealing with large projects or multiple rounds of iterative review.
[0040] Example 4: This application provides a collaborative code vulnerability review system based on evidence gaps and version constraints. This system implements the collaborative review logic described in the preceding method examples through modular functional units. The system includes an audit snapshot module, a condition creation module, a state evaluation module, a supplementary evidence arrangement module, a local re-judgment module, and a conclusion output module.
[0041] The audit snapshot module is used to acquire target code and associated configuration information to create an audit snapshot containing resource version information, and to obtain candidate vulnerability objects through at least two independent scanning paths; the audit snapshot remains unchanged during a single review. As the data baseline source for the entire review process, the audit snapshot module is responsible not only for freezing specific versions of source code and configuration files, but also for scheduling static rule scanning and independent semantic scanning tasks in parallel, merging the results of the two paths into a unified set of candidate vulnerability objects. This module ensures that all subsequent analysis actions are based on the same defined factual boundary, physically isolating external code changes from interfering with the current review session.
[0042] The condition creation module is used to create evidence condition objects for candidate propagation paths of candidate vulnerability objects. These evidence condition objects include propositions to be verified. In the system architecture, the condition creation module receives candidate objects from the audit snapshot module and transforms them into a structured set of logical propositions based on pre-defined vulnerability type templates. This transformation process maps unstructured risk clues to computable state machine nodes, providing standardized operational objects for subsequent automated verification.
[0043] The status evaluation module performs version consistency checks on analytical evidence data associated with evidence condition objects based on resource version information in the audit snapshot, and evaluates the proposition to be verified based on the verification results to determine the condition status. This module is the core hub connecting original evidence and logical judgment. It integrates multiple filters, including resource location, summary matching, and scope verification. Only valid evidence that passes these filters is used to update the condition status. This design makes status determination no longer dependent on the confidence level of a single tool, but based on procedural facts verified by version alignment, thereby improving the objectivity and accuracy of the judgment results.
[0044] The supplementary evidence orchestration module is used to generate evidence gap records and supplementary evidence analysis tasks with query ranges in response to an open-ended conditional state. When the state evaluation module reports unknown or conflicting states, the supplementary evidence orchestration module automatically intervenes, transforming the abstract evidence deficiency into a structured task node containing the target resource, gap type, and output verification rules. This module determines the specific execution strategy by querying a preset task template library, ensuring the boundedness and directionality of supplementary evidence actions and avoiding the waste of computational resources caused by blind global searches.
[0045] The local re-evaluation module performs supplementary evidence analysis to acquire new evidence data. Based on the dependency index between the analyzed evidence data, evidence condition objects, and vulnerability review conclusions, it re-evaluates the affected evidence condition objects and vulnerability review conclusions. In its implementation, the local re-evaluation module typically works in conjunction with the verification execution module. The verification execution module is responsible for actually running the analysis tools or models to produce new evidence, while the local re-evaluation module is responsible for maintaining the reverse dependency index and triggering incremental updates. This division of labor allows the system to recalculate only the nodes whose dependency links have changed, while unaffected nodes remain in their original state, thus significantly reducing the overall computational load of the system while ensuring the real-time nature of the conclusions.
[0046] The conclusion output module is used to output vulnerability review conclusions based on the re-evaluated conditional states. As the system's final output, this module strictly adheres to the closed-loop logic of evidentiary conditions to generate reports. A confirmed conclusion is only output when all necessary evidentiary conditions are met and there are no unresolved conflicts; otherwise, the pending review status and specific gap information are retained. This output strategy ensures that every conclusion delivered to the user is supported by a complete chain of evidence and has a clearly defined scope of application.
[0047] It should be understood that the aforementioned functional modules can manifest as independent software components, microservices, or logical units integrated within the same process in actual deployment. As long as they can execute the corresponding functional steps and maintain consistency in data interaction, they should all be covered within the scope of protection of this application. Furthermore, the lightweight communication mechanism, which uses object numbers and version references to share data rather than repeatedly copying the entire codebase in messages, further improves the system's operational efficiency in large-scale code auditing scenarios.
[0048] This application also provides an electronic device, including at least one processor and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which enables the at least one processor to perform the code vulnerability collaborative review method based on evidence gaps and version constraints as described in any of the foregoing method embodiments. This electronic device can be a server, workstation, cloud computing node, or dedicated security audit terminal. The processor can be a general-purpose processor (such as a CPU), digital signal processor (DSP), application-specific integrated circuit (ASIC), or field-programmable gate array (FPGA). The memory can include volatile memory (such as RAM) and non-volatile memory (such as ROM, flash memory, hard disk, etc.). When the computer program is loaded into the memory and executed by the processor, the processor is configured to perform a series of operations, including establishing audit snapshots, evaluating evidence conditions, arranging supplementary evidence tasks, and partial re-judgment. Through the combination of hardware and software, the technical solution of this application is implemented in a physical entity, providing an efficient and reliable computing platform for code security auditing.
[0049] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the code vulnerability collaborative review method based on evidentiary gaps and version constraints as described in any of the foregoing method embodiments. This computer-readable storage medium can be a tangible, non-transitory storage medium, such as a disk, optical disk, USB flash drive, or solid-state drive, or it can be a medium capable of transmission via electrical signals, optical signals, or other signals. By embedding the program instructions implementing the method of this application in the storage medium, the technical solution can be conveniently deployed and distributed on different computing devices, while also providing a multi-dimensional legal basis for patent protection.
[0050] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A collaborative code vulnerability review method based on evidence gaps and version constraints, characterized in that, include: The target code and associated configuration information are obtained to create an audit snapshot containing resource version information, and candidate vulnerability objects are obtained through at least two independent scanning paths; the audit snapshot remains unchanged during a single review. For the candidate propagation paths of the candidate vulnerability object, an evidence condition object is created, and the evidence condition object includes a proposition to be verified. Based on the resource version information in the audit snapshot, a version consistency check is performed on the analytical evidence data associated with the evidence condition object, and the proposition to be verified is evaluated based on the check result to determine the condition state. In response to the condition being in an unclosed state, an evidence gap record and a supplementary evidence analysis task with a query range are generated; The supplementary evidence analysis task is executed to obtain new evidence data, and based on the dependency index between the analyzed evidence data, the evidence condition object, and the vulnerability review conclusion, the affected evidence condition object and the vulnerability review conclusion are re-evaluated. The vulnerability review conclusion is output based on the re-evaluated conditional state.
2. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 1, characterized in that, The at least two independent scanning paths include a static rule scanning path and an independent semantic scanning path; The independent semantic scanning path does not require the output of the static rule scanning path as a necessary input; The process of obtaining candidate vulnerability objects includes: taking the union of the output results of the static rule scanning path and the independent semantic scanning path, and establishing a traceable association; wherein, the failure of any path to be hit does not constitute proof against the candidate discovered by the other path.
3. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 1, characterized in that, The step of evaluating the proposition to be verified based on the verification result to determine the conditional state includes: Based on the version consistency verification, valid evidence data applicable to the audit snapshot is selected from the analyzed evidence data; Based on the positive and negative evidence data contained in the valid evidence data, the condition state is determined according to the following rules: The condition states include support states, negation states, unknown states, and conflict states. When the positive evidence data exists and the negative evidence data does not exist, the conditional state is determined to be the support state; When the reverse evidence data exists but the positive evidence data does not exist, the conditional state is determined to be the negative state; When both the positive evidence data and the negative evidence data exist simultaneously, the conditional state is determined to be the conflict state. The unclosed state includes the unknown state and the conflict state.
4. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 3, characterized in that, When the condition state is the conflict state, the method further includes: Extract the assumptions or configuration parameters of the positive evidence data and the negative evidence data that cause the conflict; Based on the aforementioned assumptions or the differences in the configuration parameters, the candidate propagation path is split into multiple conditional branches; For each of the conditional branches, the conditional state is redefined based on the corresponding valid evidence data.
5. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 3, characterized in that, The step of filtering valid evidence data applicable to the audit snapshot from the analyzed evidence data based on the version consistency verification includes: Perform resource location verification on the analyzed evidence data to verify whether the code resource pointed to by the analyzed evidence data exists in the target code; Perform a content digest matching check on the analytical evidence data to verify whether the content digest of the analytical evidence data is consistent with the current digest of the corresponding code resource in the audit snapshot; Perform an application scope check on the analyzed evidence data to verify whether the configuration scope of the analyzed evidence data covers the candidate propagation path; The analytical evidence data that simultaneously passes the resource location verification, the content summary matching verification, and the scope of application verification is determined to be the valid evidence data.
6. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 1, characterized in that, The response to the conditional state being unclosed, generating evidence gap records and supplementary evidence analysis tasks with query ranges, includes: In response to the condition being in the unclosed state, the evidence gap record is generated, which includes the target resource identifier, gap type, and required evidence type. Query the preset task template library to obtain the target supplementary certificate template that matches the gap type; Based on the target supplementary evidence template, the target resource identifier, and the required evidence type, determine the execution tool, query scope, and output verification rules; The supplementary evidence analysis task is generated based on the execution tool, the query range, and the output verification rules.
7. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 6, characterized in that, The gap types include those with unknown input sources, missing propagation edges, unknown protection effectiveness, and unknown path conditions; When the gap type is the unknown input source type, the execution tool is configured to perform reverse data tracing with the input parameters or variables as anchors, and the output verification rules require the output source file, variable mapping and input controllable conditions; When the gap type is the propagation edge missing type, the execution tool is configured to query the relationship between actual parameters, formal parameters or return values of a specified call point, and the output verification rule requires the output of the call edge source, alias processing and analysis range; When the gap type is the type where the protection effectiveness is unknown, the execution tool is configured to read the verification function and its calling conditions to verify the target and blocking semantics. The output verification rules require the output of the protection location, target object, branch and configuration conditions. When the gap type is the unknown type of the path condition, the execution tool is configured to extract the path branch conditions and perform constraint checks or isolation verifications, and the output verification rules require the output to meet the witness or not meet the criteria.
8. The collaborative code vulnerability review method based on evidence gaps and version constraints according to claim 1, characterized in that, The process of re-evaluating the affected evidence condition objects and the vulnerability review conclusions based on the dependency index between the analyzed evidence data, the evidence condition objects, and the vulnerability review conclusions includes: Generate the dependency index, which includes a first mapping from the target code to the analysis evidence data, a second mapping from the analysis evidence data to the evidence condition object, and a third mapping from the evidence condition object to the vulnerability review conclusion. In response to the invalidation or status change of the analysis evidence data caused by the newly added evidence data, the affected evidence condition object and the vulnerability review conclusion are located based on the first mapping, the second mapping and the third mapping; Only the located evidence condition objects and the vulnerability review conclusions are re-evaluated, while the unaffected evidence condition objects and vulnerability review conclusions remain unchanged.
9. A collaborative code vulnerability review system based on evidence gaps and version constraints, characterized in that, include: The audit snapshot module is used to obtain target code and associated configuration information to establish an audit snapshot containing resource version information, and to obtain candidate vulnerability objects through at least two independent scanning paths; the audit snapshot remains unchanged during a single review process. The condition creation module is used to create evidence condition objects for the candidate propagation paths of the candidate vulnerability objects, and the evidence condition objects include propositions to be verified. The status evaluation module is used to perform version consistency verification on the analytical evidence data associated with the evidence condition object based on the resource version information in the audit snapshot, and evaluate the proposition to be verified based on the verification result to determine the condition status. The supplementary evidence arrangement module is used to generate evidence gap records and supplementary evidence analysis tasks with query range in response to the condition state being an unclosed state; The local re-evaluation module is used to perform the supplementary evidence analysis task to obtain new evidence data, and to re-evaluate the affected evidence condition objects and the vulnerability review conclusions based on the dependency index between the analyzed evidence data, the evidence condition objects, and the vulnerability review conclusions. The conclusion output module is used to output the vulnerability review conclusion based on the re-evaluated conditional state.
10. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a collaborative review of code vulnerabilities based on evidence gaps and version constraints as described in any one of claims 1 to 8.
