CN122310552B - Static vulnerability mining intelligent body system, method and device based on steering engineering - Google Patents
Static vulnerability mining intelligent body system, method and device based on steering engineeringInfo
- Publication number
- CN122310552B CN122310552B CN202610783508.6A CN202610783508A CN122310552B CN 122310552 B CN122310552 B CN 122310552B CN 202610783508 A CN202610783508 A CN 202610783508A CN 122310552 B CN122310552 B CN 122310552B
- Authority
- CN
- China
- Prior art keywords
- task
- execution
- memory
- vulnerability
- tool
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
The application discloses a static vulnerability-mining intelligent system, a static vulnerability-mining intelligent method and a static vulnerability-mining intelligent device based on a steering project, which relate to the field of artificial intelligence and are used for solving the problems of unreachable logic and missing context in the process that a static vulnerability-mining intelligent body autonomously executes a long-chain task. The method comprises the steps of constructing a static vulnerability mining intelligent system comprising an environment perception and object characterization layer, an execution layer, an arrangement layer, a memory layer, a semantic management layer and a safety layer, and forming a full-flow traceable static vulnerability mining scheme according to a logic of global constraint preposition-progressive information disclosure-full-link behavior management-autonomous closed-loop execution-achievement standardization output, and event-driven interception verification buses, prompt word dynamic loading, memory compression, task execution autonomous loop, tool authority gating and other core mechanisms of a linkage driving engineering framework. The method and the device can solve the problems of unreachable logic and missing context in the long-chain static vulnerability mining analysis task, and improve the execution efficiency and accuracy of the task.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a static vulnerability-mining intelligent system based on steering engineering, a static vulnerability-mining method and a static vulnerability-mining device.
Background
Security holes such as memory damage, out-of-range access, null pointers, authority logic defects and the like commonly exist in software, and the security holes bring security hidden danger to a computer system, so that the holes in the software need to be deeply analyzed and mined. Static vulnerability mining refers to achieving vulnerability mining by analyzing codes on the premise that target software is not operated.
Known code static vulnerability discovery tools (e.g., CPPCheck, flawfinder, etc.) rely primarily on predefined rule matching or simple grammar structure drawing to scan item code. However, in dealing with large complex projects, static analysis is commonly faced with the following bottlenecks:
a) The context is missing. For isolated code segments, the analysis tool cannot acquire global variable initialization information or external library call logic, and analysis interruption is easy to cause;
b) The path is not reachable. Because complex nested conditional branches cannot be untied, the tools cannot be associated with deep logic, and a large number of missed reports are easily caused;
c) High false alarm rate. These tools often misreport legitimate logic as a vulnerability due to lack of understanding of business logic constraints.
Compared with the static analysis Tool, researchers introduce a large Model (Large Language Model, LLM) to optimize and improve the efficiency of traditional vulnerability discovery, and a vulnerability discovery Agent (agent=model+plan+tool+memory) based on a Memory component, a planning component, a Tool calling component and the large Model is designed. However, when facing large code engineering, the problem of missing context and unreachable path caused by overflow of prompt words due to data flow and control flow, and the problem that an agent relies on manual task flow to describe, manually interacts in a loop, cannot perform long-chain task autonomous execution and the like form a new technical obstacle. The problems that the static vulnerability mining agent autonomously executes long-chain tasks are unreachable in logic, missing in context and the like need to be solved.
Disclosure of Invention
The invention aims to provide a static vulnerability-mining intelligent body system, a static vulnerability-mining intelligent body method and a static vulnerability-mining intelligent body device, aiming at all or part of the existing problems, and solves the problems of logic unreachable and context missing in the autonomous execution of long-chain tasks of the static vulnerability-mining intelligent body based on an agent=model+Harness (horse).
The technical scheme adopted by the invention is as follows:
in a first aspect, the present application provides a static vulnerability-mining intelligent system based on steering engineering, the intelligent system comprising:
The environment perception and object characterization layer is configured to identify a source point-convergence point double anchor point of a target environment of a loading task request;
The execution layer is configured to define a tool access mechanism to access and schedule external tools, generate code semantic topology of candidate vulnerabilities based on source point-sink point dual anchor points, and generate a vulnerability validation report based on successful backtracking of a taint propagation path;
Defining and controlling task execution modes, defining a task execution autonomous loop-back mechanism to control an autonomous loop-back flow of task execution;
A memory layer configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of history memory;
The semantic management layer is configured to define a prompt word dynamic loading mechanism to load the minimum effective prompt word context according to task requirements, and define a progressive disclosure mechanism to hierarchically disclose history memory according to the task requirements;
The security layer is configured to define an event-driven interception verification node mechanism to introduce pluggable control nodes respectively in a plurality of stages of task execution through a hook mechanism, and define a tool call permission gating mechanism to restrict the permission of an agent to use the tool.
Optionally, generating a code semantic topology of the candidate vulnerability based on the source-sink dual anchor includes:
And based on the source point-convergence point dual anchor points, performing forward slicing or backward slicing, extracting corresponding text information and grammar information to form the code semantic topology, wherein for the anchor points which cannot extract the text information or the grammar information, the large model is guided to generate equivalent symbol logical stubs through a defined symbolized stub mechanism.
Optionally, the autonomous loop flow of task execution includes five phases of thinking-action-observation-verification-retry/termination, wherein:
The thinking stage is to make a round of execution plan based on the task target, the history memory and the current execution state, define the tool call type, the execution action and the expected result and finish the decision of the execution plan;
the action stage is to execute specific execution actions according to the execution plan, call corresponding type tools, record action details, tool call parameters and execution states and synchronize to a memory module;
The observation stage is used for collecting a tool return result and an execution state in the action stage, comparing an expected result, identifying an execution deviation, tool abnormality and an invalid result, extracting core characteristics of the comparison result and synchronizing the core characteristics to the verification stage and the memory module;
checking the validity of the execution result of the present round, the compliance with the task target and the compliance of tool call according to the core characteristics to judge whether the next round of circulation, retry or termination is needed;
And the retry/termination stage is used for optimizing an execution plan and entering the next round of circulation according to the checking result if the task target is not reached and the execution is effective, triggering a retry strategy within a set maximum retry condition if the execution is ineffective, fusing the circulation and reporting the abnormality if the retry fails, and terminating the circulation and outputting a final result if the task target is reached or the termination condition is met.
Optionally, the hierarchical progressive memory compression mechanism is configured to:
dividing the history memory into an original full memory, a summary level compression memory and a structured index memory, wherein:
The original full memory is a history memory subjected to structuring processing;
The triggering compression condition of the abstract level compression memory is that the time length from the current task execution stage exceeds a preset time window and/or the information importance of the history memory is lower than a preset priority;
The structured index memory is the index information of the original full memory.
Optionally, when the trigger compression condition is reached, adaptively adjusting the compression strength of the original full memory according to the following principle:
The compression rate of the original full memory is within a preset maximum compression rate threshold;
and the information retention rate of the original full memory is above a preset minimum information retention threshold.
Optionally, the hook mechanism is configured to at least comprise two types of pre-hooks and post-hooks, wherein the pre-hooks and the post-hooks are respectively predefined with corresponding trigger points in a plurality of stages of task execution, and the hook mechanism comprises:
the front hook is configured to perform security and validity assessment of an execution action;
The post hook is configured to verify the tool return result, format the output, extract key information, or decide whether to trigger a subsequent step.
In a second aspect, the present application also provides a static vulnerability-mining method, which is based on the above-mentioned static vulnerability-mining agent system based on steering engineering, the method comprising:
Receiving a task request, and initializing global constraint of task execution by a linkage prompt word dynamic loading mechanism, a tool access mechanism, a tool calling authority gating mechanism, an event-driven interception and verification node mechanism and a layered progressive memory compression mechanism;
according to the global constraint, a linkage progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism are used for positioning an attack surface of a task request;
The method comprises the steps of carrying out source point-convergence point dual-anchor point identification by a linkage prompt word dynamic loading mechanism based on a positioned attack surface, generating code semantic topology of candidate vulnerabilities based on the source point-convergence point dual-anchor point, compressing and storing the code semantic topology to a memory module according to a hierarchical progressive memory compression mechanism;
The linked event-driven interception and verification node mechanism is combined with the task execution autonomous loop-back mechanism to trace back the stain propagation path;
The linkage prompt word dynamic loading mechanism performs closed-loop verification on the backtracking stain propagation path according to the event-driven interception verification node mechanism to generate a vulnerability verification report;
The method comprises the steps of carrying out task termination condition verification by a linkage event-driven interception verification node mechanism, extracting full-flow data of a task execution process from the memory module, generating a task final result report containing the vulnerability validation report, and verifying the task final result report through the event-driven interception verification node mechanism to obtain a task final result report passing verification.
Optionally, initializing global constraints for task execution includes:
analyzing the task request and extracting core parameters;
A linkage prompt word dynamic loading mechanism loads a static kernel layer prompt word and guides a large model to initialize a global management and control rule;
The linkage tool access mechanism and the tool call permission gating mechanism initialize three-level permission isolation rules based on task types and risk levels:
A first level isolation rule, namely locking a global tool white list and only opening non-invasive tools;
configuring task scene authority gating, and disabling an invasive tool;
Initializing session dynamic authority gating, and reserving an authority upgrading approval inlet in the subsequent stage;
a linkage event-driven interception verification node mechanism registers global control nodes of the whole process;
Initializing a memory module and a hierarchical compression rule of a hierarchical progressive memory compression mechanism.
Optionally, locating the attack surface of the task request includes:
According to the global constraint, a linkage progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism are used for loading top-level meta-information of a task request;
A dynamic loading mechanism of the linkage prompt words loads the prompt words of the dynamic scene layer, guides the large model to define potential attack surfaces based on the top-level meta-information, and forms an attack surface pre-positioning list;
Loading index information of a corresponding directory in the attack surface preset list, guiding a large model to locate attack surface data corresponding to potential vulnerability source points anchor points, and forming a high-priority analysis object list;
And the linkage task execution autonomous loop mechanism checks the high-priority analysis object list, if the check of the positioned attack surface fails, triggers loop retry to reload top-level meta-information and then reform the high-priority analysis object list for analysis, if the retry reaches the maximum retry condition and still fails, triggers abnormal fusing to terminate the flow, and if the check passes, the positioned attack surface is reserved.
In a third aspect, the application further provides a static vulnerability exploiting device, which comprises a processor and a storage medium, wherein the storage medium stores a computer program, and the processor runs the computer program to execute the static vulnerability exploiting method.
In summary, due to the adoption of the technical scheme, the beneficial effects of the invention are as follows:
1. according to the application, a unified standardized mechanism is defined by constructing a multi-layer collaborative static vulnerability mining agent system, the static vulnerability mining efficiency of codes is improved by adopting an agent technology, the false alarm rate of static vulnerability mining is greatly reduced, the automatic loops of static vulnerability mining discovery, analysis and verification are enhanced, and the problems of logic unreachable, up-down Wen Queshi and the like in long-chain static vulnerability mining analysis tasks are solved by adopting standard logic designs such as double-end taint anchoring, symbolized logic stub completion, full-link logic reachability verification and the like.
2. The intelligent agent task execution flow design does not depend on a solidified vulnerability analysis rule, only a standardized information supply link and a behavior management and control system are constructed, and continuous iteration of large model capacity can be adapted.
3. The application is based on the control engineering to ensure the task execution constraint of the intelligent agent, and forms the strict management and control of 'before-execution verification-in-execution management-after-execution audit' through the designs of a memory compression mechanism, a progressive disclosure mechanism, an event-driven interception verification node mechanism and the like, thereby greatly inhibiting the problems of context overflow, no constraint in operation, high misoperation rate, model illusion and the like in the intelligent agent execution process.
4. The deep fusion autonomous loop framework realizes autonomous task propulsion, abnormal autonomous processing and strategy autonomous optimization of the intelligent agent, can complete full-quantity vulnerability analysis of complex code engineering without manual intervention, and greatly improves execution efficiency.
Drawings
The invention will now be described by way of example and with reference to the accompanying drawings in which:
FIG. 1 is a construction diagram of a static vulnerability-mining agent system based on a steering project.
FIG. 2 is a flow chart of a static vulnerability discovery method implementation.
FIG. 3 is a data flow diagram of a static vulnerability discovery method implementation.
Detailed Description
All of the features disclosed in this specification, or all of the steps in a method or process disclosed, may be combined in any combination, except for mutually exclusive features and/or steps.
Any feature disclosed in this specification (including any accompanying claims, abstract) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. That is, each feature is one example only of a generic series of equivalent or similar features, unless expressly stated otherwise.
When facing large complex project codes, the currently known static vulnerability discovery tool has the problems of missing contexts, unreachable paths, high false alarm rate and the like. The currently known static vulnerability mining agent optimized by means of a large model is generally dependent on the problems of manual task flow depiction, manual interaction in a loop, incapability of performing long-chain task autonomous execution and the like besides the problems of missing context and unreachable paths. Aiming at the current situation, the application provides a static vulnerability mining intelligent body system, a static vulnerability mining intelligent body method and a static vulnerability mining intelligent body device based on a mounting engineering framework, which aim to effectively solve the problems of unreachable logic and missing context in the process of autonomously executing long-chain tasks by the static vulnerability mining intelligent body, realize the controllable and efficient operation of the intelligent body, and simultaneously build a reusable framework to improve the engineering level and scene suitability of the intelligent body.
The static vulnerability mining intelligent body system disclosed by the embodiment of the application provides an intelligent body layered architecture based on a mounting engineering, and is systematically disassembled from the bottom infrastructure to the upper vertical field application to form six core functional layers, wherein each layer follows the principle of focus separation, and the intelligent body capability is controlled to be released and engineering floor through the cooperative work of a standardized interface. The intelligent agent executes corresponding actions by guiding the large model to finish the static vulnerability mining of the user task request.
As shown in fig. 1, the static vulnerability-mining intelligent system based on the steering engineering includes:
(1) An environment perception and object characterization layer.
The environment awareness and object characterization layer is configured to perform source-sink dual anchor identification on a target environment of a load task request.
The environment perception and object representation layer realizes the target scene self-adaptive perception capability of the agent combined with the user task request so as to complement background information for the subsequent task execution.
Aiming at a static vulnerability-mining scene, the environment perception and object characterization layer is configured with the following mechanisms:
And (3) code semantic deep analysis, namely, based on a hierarchical progressive memory compression mechanism and a progressive disclosure mechanism, guiding a large model to locate potential attack surfaces such as memory management, authentication logic, user input and the like and potential vulnerability Source points (Source points) (namely Source point anchor points) through readme documents, config files, file package names, file names and the like, and providing anchor points for backward slices. Invoking a static analysis tool, and identifying a dangerous function (Sink) (namely an anchor point of a convergence point) to provide an anchor point for the forward slice.
(2) And executing a layer.
The execution layer is configured to define a tool access mechanism to access and schedule external tools. And generating the code semantic topology of the candidate vulnerability based on the source point-sink point dual anchor points. And generating a vulnerability validation report based on successful taint propagation path backtracking.
The execution layer is responsible for external tool access and scheduling. The layer faces the task flow to form a static vulnerability mining agent customization function module.
The mechanism of the execution layer definition mainly comprises:
Tool access mechanism. Static vulnerability discovery agents need to frequently call various domain-specific tools, including static detection tools, system instruction tools, custom tools, third party interfaces, and the like. The MCP (Model Context Protocol ) and Skills (skill) are adopted to solve the problem of how the tool is accessed, described and invoked. For example, tools that static vulnerability discovery agents need to access include Codeql, cppCheck, treesitter, joern, etc., access is achieved through MCP and Skills.
Candidate vulnerability semantic topology extraction mechanism. And generating the code semantic topology of the candidate vulnerability based on the source point-sink point dual anchor points. Specifically, forward slicing or backward slicing is performed based on source-sink dual-anchor points, corresponding text information and grammar information such as natural language annotation semantics, function names, parameter names, abstract grammar trees (Abstract Syntax Tree, AST), data Flow Graphs (DFG), control Flow graphs (Control Flow Graph, CFG) and the like are extracted, and code semantic topologies are formed for further analysis of a large model.
Symbolizing the stub mechanism. In the code semantic topology generation process, for anchor points which can not extract text information or grammar information, a large model is guided to generate equivalent symbol logical stubs. For example, in the process of generating the code semantic topology, when an external call (such as a library function, a kernel system call or an undefined interface) without source code is encountered, the extraction flow of text information or grammar information is interrupted. By designing a symbolized stub mechanism, for the missing third-party library function, the large model is guided to generate an equivalent symbolized logic stub by analyzing the calling context, so that the extraction process can continue to run in a logic complete mode.
Vulnerability validation and evidence chain synthesis mechanisms. And for successful taint propagation path backtracking, guiding the large model to generate a pseudo code trigger vector meeting logic constraint, and taking the pseudo code trigger vector as a vulnerability corroboration report of vulnerability existence attestation.
(3) And arranging a layer.
The orchestration layer is configured to define and manage task execution modes. And defining an autonomous loop back mechanism for executing the task to control an autonomous loop back flow for executing the task.
The scheduling layer is used as a core scheduling center of the intelligent agent executing task and is responsible for defining and controlling the task executing mode of the intelligent agent, and the scheduling layer covers the scene execution scheduling of single intelligent agent autonomous closed-loop execution, multi-intelligent agent concurrent execution, crowd intelligent cooperative execution and the like.
The mechanism of orchestration layer definition includes:
Intelligent mechanism of intelligent agent group. The intelligent group theory is taken as a core, the self-organizing collaborative paradigm of social organisms such as a bee colony, an ant colony and the like is deeply simulated, the intelligent group emergence under the global task target is realized through extremely simple behavior rules among the intelligent agents, local information interaction and autonomous decision, and the intelligent group emergence is a core arrangement mechanism for supporting the high-order task target which cannot be realized by a single intelligent agent in a complex dynamic scene through centreless collaborative and self-adaptive evolution of multiple intelligent agents.
As an optional implementation mode, an intelligent mechanism of an intelligent agent group is used for configuring an ant colony algorithm, spontaneously character evolution logic of reconnaissance ants, workers and soldiers in the ant colony is repeatedly carved, each intelligent agent autonomously claims task links, dynamically switches adaptive roles based on self-capability images, global task targets and group real-time task progress, spontaneously fills task gaps, avoids execution conflicts and defines a role semantic spaceK is the total number of character types, K is the character type index,For the kth role type, the agent(Index for agent) is inTime-of-day character selection probabilityFollowing the self-differentiation logic of the code,, wherein,Representing an agentFor measuring historical performance of the agent in the corresponding role; A completion phase of the current task (time t); representing an agent The upper label c is a cognitive state identification, which represents the comprehensive state formed by the intelligent agent based on global task, execution environment, situation and the like, of the semantic authentication state vector under the t-round autonomous loopFrom memory stateCorresponding historical memory information and current sensing information are formed together, and the state is knownAfter the checking is executed by the round, the sediment is updated to be in a memory state. Simulating a low-redundancy information interaction mode of ant colony pheromones and bee colony splay dances, constructing a local information sharing bus, enabling each intelligent agent to only transmit three types of extremely simple information of core task states, environment sensing signals and action feedback results, but not full context data, avoiding information redundancy, and realizing global strategy convergence based on a group consensus threshold value at the same time, and enabling the intelligent agents to realize global strategy convergenceIs a interaction neighborhood of (c),For collection of agents, i.e.Time of dayAgent set with information interaction, interaction information is semantic embedded vector, definitionAnd (d is a pheromone dimension) is an intelligent global pheromone matrix of the intelligent agent group, each row corresponds to an intelligent agent memory embedded vector, the updating rule corresponds to an ant colony pheromone updating formula, and the intelligent agent group is compatible with a memory compression mechanism.
;
In the formula,The memory update rate is indicated by the data,The smaller the population history memory retention the stronger. m represents the identity of the memory state,Is the individual memory state vector and the memory state of the intelligent agent after memory compression under the t-round autonomous loopIs a cognitive stateProviding historical experience support, cognitive stateIs used for updating the memory state by the result reverse iteration of (a). The anti-risk characteristics of the social biological population are simulated, and the execution failure, abnormal interruption and strategy deviation of a single agent can not cause the stagnation or failure of the global task. Judging intelligent emerging of vulnerability mining, and maximum task completion capability of single agentGroup global task completion capabilityThe two capabilities are respectively quantified according to the number of loopholes to be excavated, ifThe judgment is made that intelligence is emerging.
The task performs an autonomous loop back mechanism. The autonomous loop flow control of the task execution of the agent is realized, so that the agent can continuously advance the task target, process the execution abnormality and optimize the execution strategy in a multi-step and complex scene, and the core support of task interruption, invalid execution and logic disconnection is avoided.
As an optional implementation mode, the autonomous loop flow of task execution comprises five stages of thinking, action, observation, check, retry and termination, and the autonomous loop execution of the intelligent agent is realized through a linkage event-driven interception and verification node mechanism.
And in the thinking stage, a round of execution plan is formulated based on the task target, the history memory and the current execution state, the tool call type, the execution action and the expected result are defined, and the decision of the execution plan is completed.
And in the action stage, corresponding specific execution actions are executed according to the execution plan, corresponding type tools are called, action details, tool calling parameters and execution states are recorded, and the actions are synchronized to the memory module.
And the observation stage is used for collecting a tool return result and an execution state of the action stage, comparing an expected result, identifying an execution deviation, a tool abnormality and an invalid result, extracting core features of the comparison result (namely the identified execution deviation, tool abnormality and invalid result) and synchronizing the core features with the verification stage and the memory module.
And in the verification stage, according to the core characteristics, verifying the validity of the execution result of the round, the compliance with the task target and the compliance of tool call so as to judge whether the next round of circulation, retry or termination is required.
And the retry/termination stage is to return to the thinking stage, optimize the execution plan and enter the next cycle according to the verification result if the task target is not reached and the execution is effective, trigger a retry strategy in a set maximum retry condition (such as 3 times of maximum retry, the upper limit can be customized and modified), fuse the cycle and report the abnormality if the retry fails, and terminate the cycle and output the final result if the task target is reached or the termination condition is met.
In one possible implementation, a five-phase autonomous loop flow is formally defined using a deterministic finite state machine (DETERMINISTIC FINITE Automaton, DFA). The autonomous loop state is defined as a five-tuple: wherein the state set Corresponding to thinking, action, observation, verification, retry, and termination of six states, respectively. Initial stateInputting alphabetIn turn representing the current stateHistory memoryThe tool returns the resultValidity check markNumber of current retries. State transfer functionTerminating state set,The method refers to a termination state, and the autonomous loop is terminated only when the termination state is entered.
(4) A memory layer.
The memory layer is configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of history memory;
In the process of executing the task of the agent called by the long-flow, multi-step and multi-tool, the agent needs to continuously sense the historical behavior, tool output, task state, context constraint and staged conclusion so as to ensure that the task logic is consistent, the decision is consistent and the execution is traceable.
The mechanism defined by the memory layer includes:
A hierarchical progressive memory compression mechanism. The currently known memory mechanism adopts full memory, and as the task execution steps increase, the tool calling times increase and the interaction rounds become longer, the problems of linear expansion of the original memory volume, high information redundancy, submerged key information and the like exist. According to the application, a memory compression mechanism is defined on the basis of a memory mechanism, so that the hierarchical compression of the history memory is realized, the original memory is subjected to structuring, light weight and redundancy elimination, and the memory quantity is greatly reduced on the premise of keeping core information, and the long-term stable execution of an intelligent body is ensured.
In an alternative embodiment, the hierarchical progressive memory compression mechanism is configured to:
The history memory is divided into original full memory, summary level compression memory, and structured index memory for audit trail, context input, and quick retrieval, respectively. Triggering the staged automatic abstract compression based on the execution turn and the data length, removing redundant information, merging similar results, and refining core states and conclusions.
The original full-quantity memory is the history memory after structuring processing. And converting the unstructured text into structured task state, key data and label information so as to improve information density.
The summary-level compression memory is compression information after compressing part of the original full-volume memory, namely, not compressing the whole original full-volume memory, but retaining the whole data of part of the original full-volume memory, and compressing the rest part of the original full-volume memory. The triggering compression condition of the abstract level compression memory is that the duration of the current task execution stage exceeds a preset time window, and/or the importance of the historic memory information is lower than a preset priority. I.e. compression is performed for an original full memory that is too long (exceeds a predetermined time window) from the current moment and/or less important for information (below a preset priority), while retention is performed for an original full memory that is within a predetermined time window from the current moment or is more important for information (reaches a preset priority).
The structured index memory is the original full memory index information.
For example, a sliding window strategy is adopted, a sliding window of a preset time window is used for defining the latest original full memory, the recent memory data in the sliding window is completely reserved, the early memory outside the sliding window is compressed, only the abstract-level compression memory and the corresponding index information are reserved, and the gradual forgetting of near fineness and far coarseness is realized. The progressive compression of the sliding window sets the task execution round asThe current execution round isThe sliding window size isThe gradual forgetting strategy of near fineness and far fineness is satisfied:, (representing the original full memory of the ith round of traversal) complete reservation, Only reserve(Representing the compressed summary-level compressed memory of the original full memory of the ith round of traversal) and(Index information representing the original full memory of the ith round of traversal).
In addition, the priority of the original full-capacity memory can be further divided according to the importance of the information, the original full-capacity memory with high priority (reaching the preset priority) is forcedly reserved (the memory outside the sliding window can be covered and not covered), and the original full-capacity memory with low priority (lower than the preset priority) is preferentially compressed or discarded (the memory inside the sliding window can be covered and not covered).
Furthermore, as an alternative embodiment, upon reaching a trigger compression condition (i.e., partial compression of the original full memory), the compression strength of the original full memory is adaptively adjusted according to the following principles:
1) The compression rate for the original full memory is within a preset maximum compression rate threshold.
Define the original full memory asThe volume thereof is expressed asAfter the memory compression by the digest stage, the memory is expressed asThe volume thereof is expressed as. Compression ratio。
2) The information retention rate for the original full memory is above a preset minimum information retention threshold.
The information entropy of the original full memory is expressed asThe entropy of the information memorized after compression is expressed asInformation retention rate。
In the application, the memory compression must meet the principle of double-threshold constraint, and the minimum information retention threshold is definedAnd a maximum compression rate thresholdRequirements are that。
(5) And a semantic management layer.
The semantic management layer is configured to define a prompt word dynamic loading mechanism to load the least effective prompt word context according to task requirements. And defining a progressive disclosure mechanism to hierarchically disclose the history memory according to task requirements.
The semantic management layer is responsible for prompt word generation and prompt word management.
The mechanism defined by the semantic management layer comprises:
a prompt word dynamic loading mechanism. Aiming at the problem that the current prompt words in the intelligent agent system are hard-coded and cannot be dynamically changed according to task scenes, the application defines a prompt word dynamic loading mechanism, and the prompt words are layered into a static kernel layer, a dynamic scene layer, a tool constraint layer and a safety verification layer, wherein the specific responsibilities, execution actions and essence of the prompt words in each level are as follows, the static kernel layer prompt words are the overall fixed and overall resident bottom basic constraint of the intelligent agent, and are not changed along with task stages and scene changes. The core of the method is to define basic role positioning, overall task total targets, general behavior criteria, global safety red lines, basic reasoning norms and output format total specifications of the intelligent agent. The method comprises the steps of providing a bottom layer operation base for the whole intelligent agent, ensuring that a model does not deviate from the overall task direction, being general constraint of all tasks and not comprising any scene exclusive logic, and dynamically loading a dynamic scene layer prompt word according to the stage of the task, the type of the vulnerability and the scene constraint dynamically switched by the operation environment, wherein the task enters a new link in a staged and on-demand manner, and updating corresponding prompt content. The core of the method is business logic matched with the current stage, such as attack surface positioning rules and stain analysis requirements of a vulnerability mining stage, and tool constraint layer prompt words, namely, the method is used for loading and unloading the specific constraint aiming at the specific tool calling behavior only instantaneously before the intelligent agent initiates the tool calling, and the call is ended. The core of the method is defining tool calling format, parameter specification, input and output requirements, calling frequency limitation, white list constraint, grammar specification and tool return result analysis rule. Such as dedicated instructions when call CodeQL, treesitter, symbol execution engine, sandbox verification tool. And the security check layer prompting words are security class constraints for risk management and control, behavior audit and result compliance check, and are dynamically injected according to the current risk level, and are forcedly loaded at key nodes such as decision output, load generation, vulnerability validation and the like. The core is to carry out compliance constraint on the output content of the model, force the rationality of the verification result, and limit the intelligent agent to break through the safety boundary. And the intelligent agent output and behavior are controlled from the security level, so that the behavior can be restrained, the result can be checked and the risk can be controlled. In the task execution process, the intelligent agent triggers loading, splicing and injecting of corresponding hierarchical modules in real time according to task requirements corresponding to one or more of the current task stage, tool call type, risk level and scene characteristics, so that the minimum effective prompt word context is formed, concentration dilution is avoided, the prompt word redundancy is reduced, behavior constraint is strengthened, and the task execution accuracy of the corresponding stage is improved.
A progressive disclosure mechanism. Because of the context length limitation of the large model, when some large-scale code engineering or long-chain task execution is processed, the accumulated history context (history memory) is excessively long and is cut off passively, so that task execution fails, so that in a mechanism for controlling engineering architecture to relate to context management, a progressive disclosure mechanism needs to be introduced, namely, information/code/tool capability is not input once, but is acquired and developed in a layered manner as required, and the process of layer-by-layer exposure and gradual analysis of 'single-point clues, complete main body and deep analysis' is obeyed.
In the progressive disclosure process, the context length hard constraint is:
let the total length of accumulated context be after the kth round of disclosure It must satisfy:
;
wherein, the The information subset actually loaded for the i-layer prompt words is loaded with only the content related to the current analysis target, and not the full load; Is that Is a length of (2); An information set defined for the i-th layer of prompt words; maximum context length allowed for large models.
The progressive disclosure mechanism performs a hierarchical disclosure timing constraint in that the next layer of information can be loaded (EnableLoad) only after analysis and verification of the previous layer of information passes. The time sequence implication condition is satisfied:
;
wherein, the And (3) representing a validity check function, wherein a check result is True or False.
Through a progressive disclosure mechanism and timing constraints thereof, the problem of context overflow caused by one-time injection of the full code is thoroughly avoided under the condition of ensuring the logic accuracy of task execution.
(6) A security layer.
The security layer is configured to define an event-driven intercept verification node mechanism to introduce pluggable control nodes at various stages of task execution, respectively, via a Hook (Hook) mechanism. And, defining the tool to invoke a rights gating mechanism to restrict the rights of the agent to use the tool.
The security layer is responsible for security monitoring of the intelligent agent system, including performance monitoring, state monitoring, task monitoring and event monitoring, and realizes real-time sensing of the running state of the system and timely response of abnormal events.
The mechanism defined by the security layer includes:
Event driven intercept verification node mechanisms. In the task execution flow of the intelligent agent, based on specific event triggering (such as task receiving, tool calling, result outputting and state changing), the inserted control node with interception, verification, management and control and audit functions is used for responding to corresponding events before/after the intelligent agent executes specific behaviors to complete authority verification, dangerous behavior interception, log audit or result correction, so that the intelligent agent is finely controlled.
Specifically, the event-driven intercept verification node mechanism introduces pluggable control nodes through a hook mechanism at multiple stages of task execution, respectively.
As a specific embodiment, a four-tuple form of a single hook may be defined:, Is a defined set of hooks, wherein, A trigger event representing a hook, which is activated only when the event occurs; representing the trigger condition predicates, S represents a set of agent task states S,,Representing a set of system atomic events e that can trigger hook execution; Indicating whether s triggers the check result of e only if Triggering hook function processing logic; Representing the core processing functions of the hooks, For hook input objects (e.g. tool call requests, contexts, model outputs, task plans, etc.),Is the processed output object; the execution actions of the hooks are indicated, and the execution actions correspond to release, interception, rewriting and abnormal fusing respectively.
In an alternative embodiment, the Hook mechanism is configured to include at least two types, pre-Hook (Pre-Hook) and Post-Hook (Post-Hook), both of which may be defined as quadruple forms as described above.
The front hooks are configured to perform security and validity assessment of the (agent) execution actions. Such as limiting high risk system calls, filtering irrelevant analysis paths, performing security checks or modifying mission plans, etc.
The post hook is configured to verify the tool return, format the output, extract key information, or decide whether to trigger a subsequent step.
In addition, dynamic injection of the vulnerability pattern library can be realized through a hook mechanism, so that the system can adapt to different types of security analysis strategies in different tasks.
The pre-hooks and the post-hooks are respectively pre-defined with corresponding trigger points in a plurality of stages of task execution, including but not limited to before task planning, before context construction, before model reasoning, before and after tool calling, before result output and the like, so that the introduction of control nodes is realized.
The definition of the event-driven interception verification node mechanism enables the system to realize external management of the behavior of the intelligent agent under the condition that the model body is not modified, and pluggable control nodes are introduced into the execution flow of the intelligent agent, so that the dynamic scheduling and strategy intervention of the whole task execution process are realized.
Through a defined hook mechanism, all hooks form a built-in unified event-driven interception and verification bus, and all event-driven interception and verification nodes are integrated, so that global centralized management and control is realized. The nodes comprise authority check nodes, behavior audit nodes, danger interception nodes, abnormal fusing nodes, result check nodes and global check nodes. All the intelligent agent's action execution, tool call and state change trigger the corresponding events, and the bus scheduling related interception verification node completes the control, so as to ensure the intelligent agent to operate in the safety boundary.
The tool invokes the rights gating mechanism. The import tool invokes a rights gating mechanism to restrict the rights of the agent to use the tool. Through the mechanism, the behaviors of using tools by the intelligent agents are restrained and controlled, and tool permission isolation is formed through three-level permission isolation rules such as global tool white list gating, task scene permission gating, session dynamic permission gating and the like, so that high-risk behaviors are radically shielded.
By the aid of the built static vulnerability mining intelligent system, static vulnerability mining efficiency of codes is improved, false alarms of static vulnerability mining are greatly reduced, automatic loops of static vulnerability mining discovery, analysis and verification are enhanced, and the problems of logic unreachable, up-down Wen Queshi and the like in long-chain task analysis of the static codes are solved pertinently through double-end taint anchoring, full-link logic reachability verification and the like.
In addition, the intelligent agent task execution flow design does not depend on a solidified vulnerability analysis rule, only a standardized information supply link and a behavior management and control system are constructed, and continuous iteration of large model capacity can be adapted.
Based on the control engineering, the control logic of 'checking before execution-controlling in execution-auditing after execution' is formed by the design of a memory compression mechanism, a progressive disclosure mechanism and an event-driven interception verification node mechanism, so that the problems of overflow of contexts, no constraint in operation, high misoperation rate, model illusion and the like in the execution process of the intelligent task are avoided greatly.
The system stretches into the deep fusion autonomous loop framework, so that autonomous task propulsion, abnormal autonomous processing and strategy autonomous optimization of the intelligent agent are realized, full-quantity vulnerability analysis of complex code engineering can be completed without manual intervention, and execution efficiency is greatly improved.
According to the idea of the application, the embodiment of the application also provides a static vulnerability exploiting method based on the system. The method inherits the core capabilities of vulnerability taint propagation path analysis, semantic analysis, vulnerability verification and the like, and can continuously perfect and autonomously break through the prejudgment along with the iteration of the large model technology. Therefore, the core design objective of the task flow is not to construct a solidified vulnerability analysis logic, but to construct a precise, ordered and light information supply link by means of a mounting engineering system, the global associated information such as code semantics, semantic topology, history memory, tool output and the like is completely and compliantly transferred to a large model, sufficient data support is provided for the large model to exert autonomous reasoning and decision making capability, meanwhile, the controllability and the high efficiency of information supply are ensured through flow standardization, so that the task execution logic can adapt to the continuous evolution of the large model capability, and compared with the traditional technical path for realizing vulnerability mining through hard coding complex rules and solidification analysis logic, the task flow has stronger expansibility and engineering practicability.
The task execution flow of static vulnerability mining takes global constraint preposition-progressive information disclosure-full link behavior management and control-autonomous closed-loop execution-achievement standardization output as core logic, and event-driven interception and verification node mechanism, prompt word dynamic loading mechanism, progressive disclosure mechanism, hierarchical progressive memory compression mechanism, task execution autonomous loop mechanism, tool calling authority gating mechanism and other core mechanisms of the whole process linkage driving engineering framework, so that the whole flow of static vulnerability mining is disassembled into a plurality of sequentially progressive, loop iteration and global management and control execution stages, and an end-to-end closed loop, whole flow traceable and multi-scene multiplexing standardized execution link is formed.
As shown in fig. 2 and 3, the static vulnerability discovery method comprises the following stages:
s1, task initialization and global constraint injection.
In the S1 stage, a task request is received, a linkage prompt word dynamic loading mechanism, a tool access mechanism, a tool calling authority gating mechanism, an event-driven interception and verification node mechanism and a layered progressive memory compression mechanism are used for initializing global constraint of task execution.
The S1 stage is a starting link of task execution, and the core goal of the stage is to complete global constraints such as task boundary definition, global management and control rule injection, operation environment initialization and the like so as to solve the problems of no explicit constraint, no uniform scheduling and fuzzy safety boundary of the starting of the intelligent agent task from the source.
As an alternative embodiment, the method for initializing global constraints of task execution in S1 phase includes the following steps:
s101, receiving and analyzing a task request, and extracting core parameters.
The extracted core parameters may include core elements such as object code addresses, task types (e.g., general vulnerability mining, specified CWE type vulnerability directed mining, compliance auditing, etc.), risk management and control levels, task termination conditions, output specifications, etc.
S102, a dynamic loading mechanism of the linkage prompt words loads the prompt words of the static kernel layer, and guides the large model to initialize the global management and control rule.
And loading a static kernel layer prompt word, and defining a task total target, an intelligent agent behavior red line, an output format specification, a vulnerability research judgment standard rule and the like to construct a bottom constraint of task execution.
S103, a linkage tool access mechanism and a tool calling authority gating mechanism initialize three-level authority isolation rules based on task types and risk levels.
As in the previous embodiment, the tool invoking the rights gating mechanism defines three levels of rights isolation rules, such as global tool whitelist gating, task scene rights gating, session dynamic rights gating, and the like, in an alternative implementation. Specifically:
A first level isolation rule, namely locking a global tool white list and only opening non-invasive tools;
configuring task scene authority gating, and disabling invasive tools for high-risk operations such as system command execution, file writing and the like;
And initializing a third-level isolation rule, namely initializing session dynamic authority gating, and reserving an authority upgrading approval entrance in a subsequent stage.
It should be noted that the three-level isolation rule is not strictly hierarchically divided.
S104, a linkage event driven interception verification node mechanism registers global control nodes of the whole process.
Taking the control node defined above as an example, the registered global control node comprises a permission check node, a behavior audit node, a danger interception node, an abnormal fusing node, a result check node and a global check node, wherein the links and specific works of the nodes are respectively that the permission check node is responsible for an agent to initiate tool call, execute system operation and pre-check links before session permission is switched, so that three-level gating rules based on a global tool white list, task scene permission and session dynamic permission are realized, and whether the current agent has corresponding operation permission is checked; the behavior audit node is responsible for full-flow accompanying links before, during and after any action of an intelligent agent is executed, realizing full-quantity behavior data such as decision behavior acquisition, tool call record, parameter configuration, context change, intermediate output, retry behavior and the like of the intelligent agent, the danger interception node is responsible for decision before high-risk behavior execution, directly blocking dangerous behavior execution through a front hook, outputting risk alarm information, the abnormal fusing node is responsible for abnormal scenes such as tool call failure, constraint solution non-solution, bypass strategy failure, retry times exceeding, context overflow, logic dead loop and the like, triggering a fusing mechanism to terminate a current sub-flow or an overall task, reporting abnormal types, abnormal positions and failure reasons, avoiding the intelligent agent from falling into invalid loop, the result checking node is responsible for result output link, realizing global stage of validity, integrity, logic consistency, format and constraint satisfaction check, global check node is responsible for initializing check and cross-stage consistency check of output results, the whole process control is realized, the direction of the whole task is ensured not to deviate, the behavior is not out of range, and the achievement compliance is reliable. These control nodes ensure that all agent actions, tool calls, and state changes of the task full lifecycle are brought into the centralized control scope.
S105, initializing a memory module and a hierarchical compression rule of a hierarchical progressive memory compression mechanism.
In step S105, a task-specific memory partition is created according to a defined hierarchical progressive memory compression mechanism, three types of storage units of original full memory, abstract level compression memory and structured index memory are divided to complete initialization of a memory module, and memory compression trigger thresholds, sliding window policies (such as size and step size), information priority rules and the like are preset to complete setting of hierarchical compression rules. And the read-only mirror image loading of the target code asset is completed, the original asset and the analysis environment are isolated, and the original code is prevented from being changed in the analysis process.
In addition, step S106 may be further configured at S1 stage to complete task validity pre-verification.
S106, through a defined event-driven interception verification node mechanism (such as a front hook), carrying out compliance verification on task input parameters, target asset accessibility and management and control rule integrity, directly terminating tasks and reporting abnormal reasons if verification is not passed, locking global constraint rules if verification is passed, entering the next execution stage, and prohibiting unauthorized rule change in the whole process.
S2, pre-positioning stages of the code asset layering indexes and the attack surface.
In the S2 stage, according to the initialized global constraint, a progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism are linked to locate the attack surface of the task request.
The core objective of the S2 stage is to finish the accurate delineation of the attack surface from the macroscopic architecture to the microscopic module by means of a progressive disclosure mechanism, solve the core problems of large model context overflow, attention dilution and attack surface positioning misalignment caused by one-time input of the full code, and lock the minimum effective range for subsequent vulnerability analysis.
As an alternative embodiment, the method for locating the attack surface of the task request in the S2 stage includes the following steps:
S201, according to global constraint, linking a progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism, and loading top-level meta-information of a task request.
In step S201, following the hierarchical progressive disclosure principle of "single-point clue-complete body-deep parsing" strictly, the first round only loads the top-level meta information of the target code project (i.e. task request), including readme document, project configuration file, directory structure, package dependency list, external interface list, etc., without loading any service code file, and controls the context scale to the maximum extent.
S202, a dynamic loading mechanism of the linkage prompt words loads the prompt words of the dynamic scene layer, guides the large model to define potential attack surfaces based on the top meta information, and forms an attack surface pre-positioning list.
Step S202 is responsible for project architecture parsing and attack surface screening. And injecting a dynamic scene layer prompt word through a prompt word dynamic loading mechanism, guiding the large model to finish project architecture layering, service logic carding and technology stack identification based on top-level meta information, and defining a potential attack surface, wherein the potential attack surface comprises a user controllable input port, an identity authentication module, a memory management module, core data processing logic, a third party component interaction interface and the like, so as to form an attack surface pre-positioning list.
And S203, loading index information of a corresponding directory in the attack surface preset list, guiding the large model to locate attack surface data corresponding to the potential vulnerability source point anchor point, and forming a high-priority analysis object list.
Step S203 is responsible for attack surface refinement convergence. Based on the checked attack surface preset list, executing second-level progressive disclosure, only loading index information (such as file names, function name lists, function signatures and the like) of corresponding catalogues in the list, but not the whole code content, guiding the large model to further reduce the analysis range, positioning target files corresponding to potential vulnerability source points and attack surface data such as core functions and the like, and forming a high-priority analysis object list.
S204, the linkage task execution autonomous loop-back mechanism checks the high-priority analysis object list, if the check of the located attack surface is not passed, loop-back retrying is triggered to reload top-level meta-information and then reform the high-priority analysis object list for analysis, if the retrying reaches the maximum retrying condition and still fails to be checked, abnormal fusing is triggered, the flow is terminated, and if the check is passed, the located attack surface is reserved.
Step S204 is responsible for autonomous loop checking. The linkage task executes an autonomous loop mechanism, if the positioning result of the attack surface has no clear high risk area and is inconsistent with the project architecture logic, the loop retry is triggered, the project meta-information optimizing and analyzing strategy is reloaded, a high-priority analysis object list is formed again for analysis, the maximum number of tests is 3 (modifiable), the abnormal fusing is triggered when the 3 times of uniform retry fails, the task abnormality is reported, the flow is terminated, and the positioned attack surface is reserved when the verification passes, and the next stage is entered.
S3, identifying the two ends of the vulnerability anchor point and constructing the semantic topology.
And in the S3 stage, based on the positioned attack surface, the dynamic loading mechanism of the linkage prompt word carries out the identification of the source point-convergence point double anchor points. And generating the code semantic topology of the candidate vulnerability based on the source point-sink point dual anchor points. And according to a hierarchical progressive memory compression mechanism, storing the code semantic topology compression into a memory module.
The core objective of the S3 stage is to complete double-end anchor point locking and code semantic topology construction of vulnerability analysis, and a linkage symbolized stub mechanism solves the problems of slice flow interruption, insufficient semantic information extraction and pain points of context logic fracture caused by external calling, and provides a complete semantic basis for subsequent taint path backtracking.
In an alternative embodiment, the S3 stage comprises the steps of:
S301, identifying a source point-convergence point double anchor point.
A high-priority analysis object locked in the S2 stage is adopted, a 'Source point-convergence point double-end parallel anchoring' strategy is adopted, on one hand, tool constraint layer prompting words are injected through a prompting word dynamic loading mechanism, static analysis tools (CodeQL, cppCheck and the like) in authority gating are guided to be called by a large model, dangerous functions (Sink) in a target range are identified, the dangerous functions comprise memory operation functions, character string processing functions, system calling functions and the like, a Sink anchor point list (namely, a convergence point anchor point list) is formed, and on the other hand, source anchor points (namely, source point anchor points) controllably input by a user are locked on the basis of a pre-positioned potential vulnerability Source point (Source) to form the Source anchor point list.
S302, extracting candidate vulnerability semantic topology.
And executing a directional program slice based on the effective Source point-Sink point dual-anchor list, namely executing forward slice for each Sink anchor point, executing backward slice for each Source anchor point, and synchronously extracting text information and grammar information such as natural language annotation semantics, function names, parameter names, abstract grammar trees, data flow diagrams, control flow diagrams and the like in the slicing process to construct code semantic topology. In the slicing process, when external call (a third party library function, a kernel system call and an undefined interface) of a passive code is encountered, an event-driven interception verification node is triggered, a slicing flow is interrupted, a large model is guided to generate an equivalent symbolized logic stub based on symbolized stub mechanisms, calling contexts, function signatures, industry general library function specifications and the like, the logic equivalence of the stub is checked through a post hook, the stub is injected into the slicing flow after the check is passed, and the continuous running of the slice in a logic complete mode is ensured, so that the problem of analysis flow interruption caused by the external call is thoroughly solved.
S303, constructing and checking the code semantic topology.
In step S303, the full-scale semantic information (i.e. text information and grammar information) extracted from the slice and the symbolized logical stub are integrated to construct a code semantic topology using the taint anchor point as a core and the data stream and the control stream as links. And checking the integrity and logic consistency of the code semantic topology through a post hook, after the checking is passed, structuring the code semantic topology into a memory module, and performing abstract compression update on the full data of the slices to finish the execution of the stage.
S4, backtracking the stain path and autonomically studying and judging the feasibility of the loopholes.
In the S4 stage, based on the code semantic topology, a dynamic loading mechanism of the linked prompt words is used for identifying a complete taint propagation path. And the linkage event-driven interception verification node mechanism is combined with the task execution autonomous loop-back mechanism to trace back the stain propagation path.
S4 is a core decision link of vulnerability analysis, and the core aim is to complete full-path backtracking and feasibility research and judgment of a stain propagation path by means of task execution autonomous loop mechanism, so that the problems that only code segments are input roughly, no logic reachability check exists, and the false alarm rate is high in the prior art are solved, and accurate preliminary screening of the vulnerability is realized.
In an alternative embodiment, the S4 stage includes the steps of:
S401, directing backtracking of a stain propagation path.
Based on code semantic topology, a security check layer and a scene special prompt word are injected through a prompt word dynamic loading mechanism, a stain propagation path judgment standard, a logic reachability check rule and a vulnerability type judgment basis are defined, a large model is guided to carry out reverse stain path backtracking from a Sink anchor point to a Source anchor point, and a complete stain propagation link is identified.
S402, full-link fine-granularity control and verification.
The method comprises the steps of carrying out fine management and control through an event-driven interception and verification node mechanism in the whole process, injecting constraint conditions through a front hook before each path backtracking decision, avoiding logic jump and path misjudgment of a large model, checking the stain accessibility and logic continuity of a node through a rear hook after backtracking of a link node is completed, triggering a loop if the check is not passed, and carrying out node backtracking again.
S403, logic reachability autonomous optimization.
Aiming at the logic unreachable nodes (such as authentication interception, false condition judgment, parameter verification blocking and the like) discovered in the backtracking process, triggering a task to execute an autonomous loop-back mechanism, guiding a large model to search a bypass path again based on a code semantic topology, and completing path iterative optimization. If the complete reachable stain link cannot be formed through multiple backtracking, judging that the Sink anchor point has no effective loopholes, terminating the analysis of the Sink anchor point, and entering the processing flow of the next Sink anchor point.
S404, initial judging and checking of the loopholes.
After a complete and logically reachable stain propagation path is identified, the large model completes initial judgment of the existence of the loopholes, synchronously determines the types, the triggering conditions and the hazard levels of the loopholes to form a loophole initial judgment report, checks the logic strictness and the link integrity of the loophole initial judgment report through a rear hook, enters the next stage after the check is passed, and triggers a loop if the check is not passed, and trace back and research and judgment of the path are carried out again.
S5, leak confirmation and evidence chain closed loop synthesis stage.
And in the S5 stage, a dynamic loading mechanism of the linked prompt word performs closed-loop confirmation on the traced stain propagation path according to an event-driven interception verification node mechanism to generate a vulnerability confirmation report.
The core objective of the S5 stage is to complete theoretical validation and closed-loop evidence chain construction of the loopholes, solve the problems that in the prior art, a loophole verification link is not available, the result is not convincing, a pain point of a traceable evidence chain cannot be formed, and realize standardization and rechecking output of the loophole mining result.
In an alternative embodiment, stage S5 includes the steps of:
s501, generating a vulnerability triggering vector.
Based on the vulnerability initial judgment report and the complete taint propagation link, a special prompting word for vulnerability verification is injected through a prompting word dynamic loading mechanism, a large model is guided to generate a pseudo code triggering vector (POC) meeting triggering conditions based on logic constraint, input conditions and path triggering requirements of a taint propagation path, and theoretical confirmation of vulnerability existence is completed.
S502, safety verification and evidence chain synthesis.
The linkage front hook performs security check on the generated POC, strictly prohibits the generation of codes containing destructive and malicious execution logic, only allows the generation of non-invasive pseudo codes for theoretical verification, and triggers loop regeneration if the verification is not passed. After verification, the POC is strongly associated with the stain propagation path, the code semantic topology, the anchor point positioning basis and the vulnerability type judging rule to form a vulnerability evidence chain of a full closed loop.
S503, checking and archiving achievements.
And finally checking the integrity, the closed loop and the compliance of the vulnerability evidence chain through a post hook, wherein the check dimension comprises whether a stain propagation path is complete, whether POC meets the logic constraint of a full path, whether the vulnerability type and the hazard level are accurate or not, forming a standardized vulnerability validation report after the check is passed, triggering retry loop optimization if the check is not passed, and marking the vulnerability as to-be-manually rechecked if the retry fails for 3 times (configurable).
S6, task termination and achievement standardization filing stage.
And in the S6 stage, the linked event driven interception and verification node mechanism performs task termination condition verification. And extracting full-flow data of the task execution process from the memory module, and generating a task final result report containing the vulnerability validation report. And checking the task final result report through an event-driven interception and verification node mechanism to obtain a task final result report passing the checking.
The S6 stage is a ending link of task execution, and the core aims to finish task closed-loop termination, achievement standardization output and reusable asset precipitation, so as to solve the pain points that the task has no definite termination condition, the achievement has no unified specification and the architecture and experience cannot be reused in the prior art.
In an alternative embodiment, stage S6 includes the steps of:
s601, checking a task termination condition.
Triggering event-driven interception verification bus global check nodes to check the execution state of the whole task, wherein all taint anchors are analyzed completely, all valid vulnerabilities are confirmed completely, the analysis task is not to be executed, and the preset termination condition of the task is met. After verification is passed, formally stopping task execution autonomous loop, and locking all execution products of the task.
S602, final result integration and output.
The linkage memory module extracts the core information of the whole process of the task from the three memory partitions, integrates and forms a standardized final task result report, and comprises a task execution profile (which can be analyzed in the S1 stage), an attack surface positioning result, a stain anchor point analysis list (Source anchor point list and Sink anchor point list), a complete vulnerability evidence chain, a vulnerability confirmation report and the like.
S603, archiving achievements and depositing assets.
And (3) carrying out compliance and integrity final inspection on the final result report of the heating medium through a rear hook, and finishing persistent archiving after verification is passed, namely archiving the final successful report of the task, the full audit log and the original analysis product to a storage system, thereby realizing full life cycle traceability.
S604, releasing the resources.
And releasing the tool authority, the memory resource and the session context occupied by the task, and completing the execution closed loop of the whole-flow task.
According to the idea of the present application, an embodiment of the present application further provides a static vulnerability exploiting device, where the device includes a processor and a storage medium, where the storage medium stores a computer program, and the processor runs the computer program to execute the static vulnerability exploiting method of the above embodiment.
The invention is not limited to the specific embodiments described above. The invention extends to any novel one, or any novel combination, of the features disclosed in this specification, as well as to any novel one, or any novel combination, of the steps of the method or process disclosed.
Claims (10)
1. A static vulnerability-mining intelligent system based on a steering project, characterized in that the intelligent system comprises a cooperative work:
The environment perception and object characterization layer is configured to identify a source point-convergence point double anchor point of a target environment of a loading task request;
The execution layer is configured to define a tool access mechanism to access and schedule external tools, generate code semantic topology of candidate vulnerabilities based on source point-sink point dual anchor points, and generate a vulnerability validation report based on successful backtracking of a taint propagation path;
Defining and controlling task execution modes, defining a task execution autonomous loop-back mechanism to control an autonomous loop-back flow of task execution;
A memory layer configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of history memory;
The semantic management layer is configured to define a prompt word dynamic loading mechanism to load the minimum effective prompt word context according to task requirements, and define a progressive disclosure mechanism to hierarchically disclose history memory according to the task requirements;
The security layer is configured to define an event-driven interception verification node mechanism to introduce pluggable control nodes respectively in a plurality of stages of task execution through a hook mechanism, and define a tool call permission gating mechanism to restrict the permission of an agent to use the tool.
2. The static vulnerability-mining agent system based on steering engineering of claim 1, wherein generating a code semantic topology of candidate vulnerabilities based on source-sink dual anchors comprises:
And based on the source point-convergence point dual anchor points, performing forward slicing or backward slicing, extracting corresponding text information and grammar information to form the code semantic topology, wherein for the anchor points which cannot extract the text information or the grammar information, the large model is guided to generate equivalent symbol logical stubs through a defined symbolized stub mechanism.
3. The static vulnerability-mining agent system based on steering engineering of claim 1, wherein the autonomous loop flow of task execution comprises five phases of thinking-action-observation-check-retry/terminate, wherein:
The thinking stage is to make a round of execution plan based on the task target, the history memory and the current execution state, define the tool call type, the execution action and the expected result and finish the decision of the execution plan;
the action stage is to execute specific execution actions according to the execution plan, call corresponding type tools, record action details, tool call parameters and execution states and synchronize to a memory module;
The observation stage is used for collecting a tool return result and an execution state in the action stage, comparing an expected result, identifying an execution deviation, tool abnormality and an invalid result, extracting core characteristics of the comparison result and synchronizing the core characteristics to the verification stage and the memory module;
checking the validity of the execution result of the present round, the compliance with the task target and the compliance of tool call according to the core characteristics to judge whether the next round of circulation, retry or termination is needed;
And the retry/termination stage is used for optimizing an execution plan and entering the next round of circulation according to the checking result if the task target is not reached and the execution is effective, triggering a retry strategy within a set maximum retry condition if the execution is ineffective, fusing the circulation and reporting the abnormality if the retry fails, and terminating the circulation and outputting a final result if the task target is reached or the termination condition is met.
4. The steering engineering based static vulnerability mining agent system of claim 1, wherein the hierarchical progressive memory compression mechanism is configured to:
dividing the history memory into an original full memory, a summary level compression memory and a structured index memory, wherein:
The original full memory is a history memory subjected to structuring processing;
The triggering compression condition of the abstract level compression memory is that the time length from the current task execution stage exceeds a preset time window and/or the information importance of the history memory is lower than a preset priority;
The structured index memory is the index information of the original full memory.
5. The static vulnerability mining agent system based on steering engineering of claim 4, wherein upon reaching the trigger compression condition, the compression strength of the original full memory is adaptively adjusted according to the following principles:
The compression rate of the original full memory is within a preset maximum compression rate threshold;
and the information retention rate of the original full memory is above a preset minimum information retention threshold.
6. The static vulnerability-mining agent system based on steering engineering of claim 1, wherein the hook mechanism is configured to comprise at least two classes, pre-hooks and post-hooks, wherein the pre-hooks and the post-hooks are pre-defined with corresponding trigger points at multiple stages of task execution, respectively, wherein:
the front hook is configured to perform security and validity assessment of an execution action;
The post hook is configured to verify the tool return result, format the output, extract key information, or decide whether to trigger a subsequent step.
7. A static vulnerability-mining method based on the engineering-driven-based static vulnerability-mining agent system of any one of claims 1-6, comprising:
Receiving a task request, and initializing global constraint of task execution by a linkage prompt word dynamic loading mechanism, a tool access mechanism, a tool calling authority gating mechanism, an event-driven interception and verification node mechanism and a layered progressive memory compression mechanism;
according to the global constraint, a linkage progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism are used for positioning an attack surface of a task request;
The method comprises the steps of carrying out source point-convergence point dual-anchor point identification by a linkage prompt word dynamic loading mechanism based on a positioned attack surface, generating code semantic topology of candidate vulnerabilities based on the source point-convergence point dual-anchor point, compressing and storing the code semantic topology to a memory module according to a hierarchical progressive memory compression mechanism;
The linked event-driven interception and verification node mechanism is combined with the task execution autonomous loop-back mechanism to trace back the stain propagation path;
The linkage prompt word dynamic loading mechanism performs closed-loop verification on the backtracking stain propagation path according to the event-driven interception verification node mechanism to generate a vulnerability verification report;
The method comprises the steps of carrying out task termination condition verification by a linkage event-driven interception verification node mechanism, extracting full-flow data of a task execution process from the memory module, generating a task final result report containing the vulnerability validation report, and verifying the task final result report through the event-driven interception verification node mechanism to obtain a task final result report passing verification.
8. The static vulnerability-mining method of claim 7, wherein initializing global constraints for task execution comprises:
analyzing the task request and extracting core parameters;
A linkage prompt word dynamic loading mechanism loads a static kernel layer prompt word and guides a large model to initialize a global management and control rule;
The linkage tool access mechanism and the tool call permission gating mechanism initialize three-level permission isolation rules based on task types and risk levels:
A first level isolation rule, namely locking a global tool white list and only opening non-invasive tools;
configuring task scene authority gating, and disabling an invasive tool;
Initializing session dynamic authority gating, and reserving an authority upgrading approval inlet in the subsequent stage;
a linkage event-driven interception verification node mechanism registers global control nodes of the whole process;
Initializing a memory module and a hierarchical compression rule of a hierarchical progressive memory compression mechanism.
9. The static vulnerability-mining method of claim 7, wherein locating the attack face of the task request comprises:
According to the global constraint, a linkage progressive disclosure mechanism, a prompt word dynamic loading mechanism and a task execution autonomous loop-back mechanism are used for loading top-level meta-information of a task request;
A dynamic loading mechanism of the linkage prompt words loads the prompt words of the dynamic scene layer, guides the large model to define potential attack surfaces based on the top-level meta-information, and forms an attack surface pre-positioning list;
Loading index information of a corresponding directory in the attack surface preset list, guiding a large model to locate attack surface data corresponding to potential vulnerability source points anchor points, and forming a high-priority analysis object list;
And the linkage task execution autonomous loop mechanism checks the high-priority analysis object list, if the check of the positioned attack surface fails, triggers loop retry to reload top-level meta-information and then reform the high-priority analysis object list for analysis, if the retry reaches the maximum retry condition and still fails, triggers abnormal fusing to terminate the flow, and if the check passes, the positioned attack surface is reserved.
10. A static vulnerability discovery apparatus comprising a processor and a storage medium, wherein the storage medium stores a computer program, and the processor runs the computer program to perform the static vulnerability discovery method of any one of claims 7-9.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202610783508.6A CN122310552B (en) | 2026-06-02 | 2026-06-02 | Static vulnerability mining intelligent body system, method and device based on steering engineering |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202610783508.6A CN122310552B (en) | 2026-06-02 | 2026-06-02 | Static vulnerability mining intelligent body system, method and device based on steering engineering |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN122310552A CN122310552A (en) | 2026-06-30 |
| CN122310552B true CN122310552B (en) | 2026-08-14 |
Family
ID=100294295
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202610783508.6A Active CN122310552B (en) | 2026-06-02 | 2026-06-02 | Static vulnerability mining intelligent body system, method and device based on steering engineering |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN122310552B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN122489159A (en) * | 2026-07-01 | 2026-07-31 | 宁波均联智行科技股份有限公司 | Intelligent cabin system and control method |
| CN122655783A (en) * | 2026-07-23 | 2026-08-28 | 武汉凌久微电子有限公司 | Progressive disclosure method and system for providing context for AI Agent uniformly and flexibly |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121743212A (en) * | 2025-12-25 | 2026-03-27 | 中国人民解放军陆军兵种大学 | Large model assisted Fuzz test Harness generation method and system |
| CN121841858A (en) * | 2026-03-12 | 2026-04-10 | 重庆市信息通信咨询设计院有限公司 | Vulnerability POC (point of care) generation method based on AI (advanced technology attachment) agent |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4369226A1 (en) * | 2022-11-14 | 2024-05-15 | Rockwell Collins, Inc. | Protecting computer systems |
-
2026
- 2026-06-02 CN CN202610783508.6A patent/CN122310552B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121743212A (en) * | 2025-12-25 | 2026-03-27 | 中国人民解放军陆军兵种大学 | Large model assisted Fuzz test Harness generation method and system |
| CN121841858A (en) * | 2026-03-12 | 2026-04-10 | 重庆市信息通信咨询设计院有限公司 | Vulnerability POC (point of care) generation method based on AI (advanced technology attachment) agent |
Also Published As
| Publication number | Publication date |
|---|---|
| CN122310552A (en) | 2026-06-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN122310552A (en) | Static vulnerability mining intelligent agent system, method, and apparatus based on driving engineering | |
| CN120750631B (en) | Method and device for generating security event research and judgment script based on natural language processing | |
| CN121187549B (en) | Automatic multisource analysis and integrated processing system based on artificial intelligence | |
| CN122470427B (en) | Operation and maintenance intelligent agent operating system and method based on separation of control and two-level memory self-evolution | |
| Li et al. | Agent harness engineering: A survey | |
| CN121441597A (en) | A Multi-Agent Collaborative RESTful API Vulnerability Testing Method | |
| Saleh | DevSecLogs: AI-powered, tamper-evident log intelligence for secure CI/CD pipelines | |
| Al-Sabbagh et al. | Autosecagent: a semi-automated AI-driven penetration testing framework through recursive memory and real-time RAG: A. Al-Sabbagh et al. | |
| CN122365521B (en) | A vulnerability exploitation intelligent agent system, method, and apparatus based on driving engineering | |
| Augé et al. | MAS-Lab: A Specification-Driven Validation Framework for Reliable Multi-Agent Systems | |
| Liu | Intelligence Entropy Principle and the ADE Stability Engineering Framework | |
| CN121596805B (en) | A formal verification method and system for industrial control systems | |
| CN122333488B (en) | Security audit method and system based on intelligent agent | |
| Hemza | Pokročilý webový nástroj pro správu bezpečnostních korelačních pravidel a kyberbezpečnostních reakcí | |
| CN122387463A (en) | Deployment method and device of artificial intelligence system and electronic equipment | |
| An et al. | GO-MAF: A Human-in-the-Loop Multi-Agent Framework for Self-Healing 5/6G Network Operations | |
| Harel | STPD–Operational Design as a Model‐Based Extension of STPA | |
| Trigka et al. | Autonomous AI Agents in Cybersecurity: Operational Properties, Failure Conditions, and Security Implications | |
| Piovesan | Contracts, Events, and Orchestration | |
| CN121658007A (en) | Software automation construction system, method and related equipment for proton therapy systems | |
| CN122661015A (en) | Network security operation system and method based on security arrangement automation and self-adaption | |
| Dănescu | PARAMETER-DRIVEN GENERATION OF ATTACK-FAULT TREES FOR MULTI-TENANT ONBOARD SOFTWARE ARCHITECTURES | |
| CN122268643A (en) | All-link security defense method and device for autonomous intelligent agent | |
| Iivanainen et al. | Generative AI Integration in Dashtera | |
| CN122419995A (en) | Security operation strategy generation method, system, equipment and medium based on attack and defense exercise data driving |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |