Example code malicious injection security test method and device oriented to intelligent system with body
By conducting malicious code injection tests on the sample code list of the embodied intelligent system, using the generalization capabilities of the large language model to simulate attack scenarios and assess system vulnerabilities, the problem of insufficient security testing of the embodied intelligent system is solved, and potential threats can be discovered and repaired in a timely manner.
Patent Information
- Application Number
- CN202510754016.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-16
AI Technical Summary
The existing embodied intelligent system lacks an effective security testing mechanism and is unable to detect and prevent threats caused by malicious injection of sample code.
A preset attack paradigm is used to inject malicious code into the sample code list of the embodied smart device, and the system vulnerability is evaluated through multiple rounds of instruction testing. The generalization capability of the large language model is used to simulate actual attack scenarios, record the false trigger rate and attack success rate, and perform weighted calculations to evaluate the system vulnerability.
Effectively discover and evaluate security risks of embodied intelligent systems, provide quantitative vulnerability assessment values, help developers fix security vulnerabilities in a timely manner, and improve system security.
Smart Images

Figure CN120654236A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence security technology, and specifically relates to a sample code malicious injection security testing method and device for embodied intelligent systems. Background Art
[0002] In embodied intelligence driven by large language models, prompt word engineering requires a relatively low technical threshold, making it accessible to non-professional developers. While prompt word engineering has limitations in terms of pre-trained knowledge, and the intelligence interacts with the large language model in a black-box manner, its basic capabilities, such as code generation, still hold potential value and can be used to guide the action code of embodied intelligence systems. When deploying robots based on large language models, directly translating abstract natural language instructions into executable action code remains challenging. This is primarily because large language models cannot perceive the specific configuration or equipment information of end devices, nor the complexity of executable tasks, based solely on limited input content.
[0003] To address this issue, developers introduced sample code lists and deployed them on edge embodied intelligent devices to guide the large language model in translating natural language instructions into executable code blocks for the embodied intelligent device. The specific process is as follows: After receiving user instructions, the embodied intelligent device, acting as an edge device, adds a series of auxiliary prompts as input. The input is then transmitted over the network to the cloud-based large language model. The large language model then generates the corresponding executable code blocks based on the user instructions and the added auxiliary prompts. The code blocks are then transmitted back to the embodied intelligent device for execution, thus meeting the user's needs. This is currently a mainstream approach to driving embodied intelligence with large language models. The auxiliary prompts consist of two main components: one is the required text that instructs the large language model to generate the corresponding executable code according to the instructions; the other is examples of the instruction-to-executable code pairing, which the large language model uses to learn the corresponding relationship. These examples are typically presented in the form of a list of examples from multiple different scenarios. This allows developers to leverage the generalization capabilities of the large language model to enable the embodied intelligent device to handle tasks in most scenarios by providing only a few code examples. Specifically, when the user issues a command I, the embodied smart device at the edge sends the command I and the sample code list D as input to the large language model in the cloud for code generation. The sample code list D contains sample commands similar to command I. d With executable code block A d Example of pairing d=I d A d ,d∈λ. An executable code block can be represented as a sequence of single task execution codes arranged in a specific order, i.e. When the large language model receives instruction I and sample code list D, it searches for similar sample instruction I in sample code list D based on the content of instruction I.d And match the corresponding executable code block A d Utilizing the generalization capability of the large language model, the large language model generates executable code that matches instruction I according to the actual scenario requirements and sends it to the embodied intelligent device for execution. Therefore, this process can be formally expressed as:
[0004]
[0005] However, this method of controlling embodied smart devices exposes a critical vulnerability: flawed code, once executed, can pose a serious threat to the user and their environment, a phenomenon often overlooked by large language models. Currently, there is no effective security testing mechanism to address this risk. Summary of the Invention
[0006] In response to the problems existing in the prior art, the present invention provides a sample code malicious injection security testing method and device for embodied intelligent systems, which aims to solve the problem of invalid security testing mechanism of embodied intelligent systems.
[0007] In order to solve the above technical problems, the present invention is implemented through the following technical solutions:
[0008] According to a first aspect of the present invention, a sample code malicious injection security testing method for an embodied intelligent system is provided, comprising:
[0009] Step 1: Using a preset attack paradigm, malicious code is injected into the unmodified sample code list in the target embodied smart device to obtain a sample code list attacked by the malicious code;
[0010] Step 2: The target embodied intelligent device receives a first instruction and sends the first instruction and a list of sample codes attacked by malicious code to a cloud-based large language model; the first instruction is characterized as a natural language instruction;
[0011] Step 3: The target embodied intelligent device receives and executes the first executable code to obtain a first execution result; the first executable code is obtained by inference and calculation by a cloud-based large language model based on the first instruction and a list of example codes attacked by the malicious code;
[0012] Step 4: Determine, based on the first executable code, whether the first execution result meets the expected execution result corresponding to the first instruction; if not, record it as a false trigger;
[0013] Step 5: The target embodied intelligent device receives the second instruction and sends the second instruction and a list of sample codes attacked by the malicious code to the cloud-based large language model; the second instruction is characterized as a signal instruction that cannot be inferred for a specific purpose, or an instruction that combines a natural language instruction with a signal instruction;
[0014] Step 6: The target embodied intelligent device receives and executes the second executable code to obtain a second execution result; the second executable code is obtained by inference and calculation by the cloud-based large language model based on the second instruction and the list of example codes attacked by the malicious code;
[0015] Step 7: Determine whether the second execution result matches the expected execution result corresponding to the second instruction in combination with the second executable code. If so, record the result as a successful attack.
[0016] Step 8: Repeat steps 2 to 7 several times to determine the false trigger rate and the attack success rate, and perform weighted calculation on the false trigger rate and the attack success rate to obtain the vulnerability assessment value of the target embodied smart device.
[0017] In a possible implementation of the first aspect, the malicious code is injected into the unmodified sample code list in the target embodied smart device using a preset attack paradigm to obtain the sample code list attacked by the malicious code, specifically:
[0018]
[0019] Where D T is a list of sample codes attacked by malicious code; D is a list of sample codes that have not been tampered with; The second instruction in the example code list that is attacked by malicious code; is the malicious code corresponding to the second instruction in the sample code list attacked by malicious code; M is the number of malicious codes injected in the untampered sample code list; N is the total number of steps in the executable code block; A d The executable code block in the unmodified sample code list; a i is the i-th step in the executable code block; j is the j-th step; k is the k-th step;
[0020] The preset attack paradigm includes at least one of a sequence exchange operation, a step addition operation, a content replacement operation, a step missing operation, an amplitude change operation, a direction change operation, and a step differential operation.
[0021] In a possible implementation of the first aspect, the sequence exchange operation is specifically:
[0022]
[0023] Where, Malicious code injected using sequence exchange as the attack paradigm.
[0024] In a possible implementation of the first aspect, the adding step is specifically performed as follows:
[0025]
[0026] Where, is the malicious code injected using the add step attack pattern; r is the rth step; q is the qth step.
[0027] In a possible implementation of the first aspect, the content replacement operation is specifically:
[0028]
[0029] Where, is the malicious code injected using content replacement as the attack paradigm; r is the rth step; q is the qth step.
[0030] In a possible implementation manner of the first aspect, the missing step operation specifically includes:
[0031]
[0032] Where, Malicious code injected using the missing steps attack paradigm.
[0033] In a possible implementation manner of the first aspect, the amplitude changing operation is specifically:
[0034]
[0035] Where, is the malicious code injected with amplitude variation as the attack paradigm; λ is an arbitrary real number.
[0036] In a possible implementation manner of the first aspect, the direction change operation is specifically:
[0037]
[0038] Where, Malicious code injected using direction change as the attack paradigm.
[0039] In a possible implementation of the first aspect, the step differential operation is specifically:
[0040]
[0041] Where, It is a malicious code injected using step differentiation as the attack paradigm.
[0042] According to a second aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for security testing of malicious code injection for an embodied intelligent system is implemented.
[0043] Compared with the prior art, the present invention has at least the following beneficial effects:
[0044] This invention provides a security testing method for malicious sample code injection in embodied intelligent systems. This method, proposed for the first time specifically for embodied intelligent systems, effectively addresses the issue of ineffective security testing mechanisms in the prior art. Specifically, by injecting malicious code into a list of sample codes deployed in an embodied intelligent device based on different usage scenarios, and employing multiple rounds of testing with different instructions, the vulnerability of the embodied intelligent system is comprehensively assessed. During the testing process, not only natural language instructions are considered, but also signal instructions whose specific purpose cannot be inferred, or instructions that combine natural language instructions with signal instructions, are introduced. This allows for a more realistic simulation of various possible attacks in real-world scenarios, thereby more accurately assessing the system's vulnerability under different attack scenarios. By recording the false trigger rate and attack success rate and performing a weighted calculation on the two, a vulnerability assessment value for the target embodied intelligent device is obtained. This quantitative assessment method intuitively reflects the system's vulnerability level, providing developers and managers with a clear reference basis for implementing appropriate security measures to address the system's weak links and improve system security. The attack paradigm framework employed in this paper leverages the ability of large language models to learn the relationship between instructions and executable code, linking malicious code to specific signal instructions. This attack method can bypass existing malicious code detection environments and effectively expose the vulnerabilities of embodied intelligent systems. In this way, developers can promptly identify potential security risks in the system and implement preventative measures to prevent malicious attacks in real-world applications. The security testing method provided by this paper allows developers to promptly identify and fix potential security vulnerabilities in sample code before deploying or during the operation of embodied intelligent systems.
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the specific embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the specific embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0047] Figure 1 This is a flowchart of a sample code malicious injection security testing method for an embodied intelligent system according to the present invention;
[0048] Figure 2 This is the effect of the example code malicious injection security testing method for embodied intelligent systems on a simulation platform in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0050] In an embodied intelligence system driven by a large language model, the embodied intelligence system comprises an edge embodied intelligent device and a cloud-based large language model. The edge embodied intelligent device receives user commands and interacts with the cloud-based large language model to obtain executable code, thereby performing the corresponding task. The method of the present invention will be used to test the security of this embodied intelligence system in the event of malicious injection of sample code.
[0051] like Figure 1 As shown, an embodiment of the present invention provides an example code malicious injection security testing method for an embodied intelligent system, which specifically includes the following steps:
[0052] Step 1: Use a preset attack paradigm to inject malicious code into the unmodified sample code list in the target embodied smart device to obtain a sample code list attacked by the malicious code.
[0053] Specifically, the attack begins by obtaining a list of unmodified sample code from the target embodied intelligent device. This list contains a series of examples of instruction and executable code paired together. Each example consists of a natural language instruction and a corresponding executable code block. An executable code block is a sequence of code that executes a single task in a specific order. Malicious code is then injected into the unmodified sample code list according to a pre-defined attack pattern.
[0054] The malicious code injection method is to tamper with the content of the sample code list deployed inside the embodied smart device, affecting the large language model's understanding of the correspondence between user instructions and the corresponding executable code, and then generate executable code that produces malicious behavior.
[0055] In one possible implementation, a preset attack paradigm is used to inject malicious code into the unmodified sample code list in the target embodied smart device to obtain a sample code list attacked by the malicious code. This process can be formally expressed as follows:
[0056]
[0057] Where D T is a list of sample codes attacked by malicious code; D is a list of sample codes that have not been tampered with; The second instruction in the example code list that is attacked by malicious code; is the malicious code corresponding to the second instruction in the sample code list attacked by malicious code; M is the number of malicious codes injected in the untampered sample code list; N is the total number of steps in the executable code block; A d The executable code block in the unmodified sample code list; a i is the i-th step in the executable code block (i.e., the basic behavior unit of the executable code block); j is the j-th step; and k is the k-th step.
[0058] Indicates that the executable code blocks in the unmodified sample code list are divided into three parts according to the execution order.
[0059] In this embodiment, the preset attack pattern may include the following operations:
[0060] Sequential swap operation, this attack paradigm is implemented by swapping the positions of at least two parts of the executable code block in the unmodified sample code list. The specific formalization is as follows:
[0061]
[0062] Where, Malicious code injected using sequence exchange as the attack paradigm.
[0063] Adding step operations, this attack paradigm is implemented by adding additional steps to the executable code block in the unmodified sample code list. The specific formalization is as follows:
[0064]
[0065] Where, is the malicious code injected using the add step attack pattern; r is the rth step; q is the qth step.
[0066] Content replacement operation. This attack pattern is implemented by replacing a part of the executable code block in the unmodified sample code list with other content. The specific formalization is as follows:
[0067]
[0068] Where, is the malicious code injected using content replacement as the attack paradigm; r is the rth step; q is the qth step.
[0069] The attack pattern is implemented by deleting the key steps in the executable code block in the unmodified sample code list. The specific formalization is as follows:
[0070]
[0071] Where, Malicious code injected using the missing steps attack paradigm.
[0072] Amplitude change operation, this attack paradigm is implemented by modifying the size of the value in the executable code block in the untampered sample code list. The specific formalization is as follows:
[0073]
[0074] Where, is the malicious code injected with amplitude variation as the attack paradigm; λ is an arbitrary real number.
[0075] Direction change operation, this attack paradigm is implemented by modifying the value representing the direction in the executable code block in the unmodified sample code list. The specific formalization is as follows:
[0076]
[0077] Where, Malicious code injected using direction change as the attack paradigm.
[0078] Step differentiation operation. This attack paradigm differentiates certain steps in the executable code block in the unmodified sample code list, that is, splits them into tiny steps. While ensuring that the final result is consistent with the executable code block in the unmodified sample code list, redundant actions are generated during the execution process, resulting in excessive resource consumption and component wear. The specific formalization is as follows:
[0079]
[0080] Where, It is a malicious code injected using step differentiation as the attack paradigm.
[0081] According to the above seven attack paradigms, they can be freely combined and executed simultaneously according to different intentions, thus causing a chain reaction.
[0082] Step 2: The target embodied intelligent device receives the first instruction and compares the first instruction with the sample code list D attacked by the malicious code. T Sent to the cloud-based large language model; the first instruction is characterized by a natural language instruction.
[0083] Specifically, the target embodied smart device receives a first natural language command from the user, such as "Turn on the room lights." The target embodied smart device uses the first command and a list of sample code vulnerable to malicious code as input and transmits it to the cloud-based large language model via network transmission.
[0084] After receiving the input, the cloud-based large language model searches for similar example instructions in a list of example codes that have been targeted by malicious code based on the content of the first instruction and matches the corresponding executable code block. Leveraging the generalization capabilities of the cloud-based large language model, the model generates a first executable code that matches the first instruction and transmits the first executable code back to the target embodied intelligent device.
[0085] Step 3: The target embodied intelligent device receives and executes the first executable code to obtain a first execution result; the first executable code is obtained by inference and calculation by the cloud-based large language model based on the first instruction and the list of sample codes attacked by malicious code.
[0086] For example, the first executable code should originally turn on the room lights normally, but because the sample code list is maliciously injected, the first execution result may be that the lights flicker abnormally or cannot be turned on normally.
[0087] Step 4: In combination with the first executable code, determine whether the first execution result meets the expected execution result corresponding to the first instruction. If not, record it as a false trigger.
[0088] That is to say, it is determined whether the first execution result is consistent with the expected execution result corresponding to the first instruction. If it is consistent, it means that it is not affected by malicious code injection; if it is not consistent, it means that it is affected by malicious code injection, and it is recorded as a false trigger.
[0089] For example, the expected execution result corresponding to the first instruction is that the room light turns on normally. If the first execution result (ie, the actual execution result, such as the light flickers abnormally) does not meet the expected execution result, it is recorded as a false trigger.
[0090] Step 5: The target embodied intelligent device receives a second instruction and sends the second instruction and a list of sample codes attacked by malicious code to the cloud-based large language model; the second instruction is characterized by a signal instruction that cannot be inferred for a specific purpose, or an instruction that combines a natural language instruction with a signal instruction.
[0091] For example, the signal instruction is a meaningless character string, and the instruction combining the natural language instruction and the signal instruction is “turn on the room light cp–s, or cp–s turns on the room light”.
[0092] The target embodied intelligent device sends the second instruction and a list of sample code vulnerable to the malicious code to the cloud-based large language model. The cloud-based large language model performs inference calculations based on the second instruction and the list of sample code vulnerable to the malicious code, generates a second executable code, and transmits the second executable code back to the target embodied intelligent device.
[0093] Step 6: The target embodied intelligent device receives and executes the second executable code to obtain a second execution result; the second executable code is obtained by inference and calculation by the cloud-based large language model based on the second instruction and the sample code list attacked by the malicious code.
[0094] For example, the second executable code is controlled by maliciously injected code and performs dangerous operations that are not expected by the user, such as turning off the power of an important device.
[0095] Step 7: In combination with the second executable code, determine whether the second execution result meets the expected execution result corresponding to the second instruction. If so, record it as a successful attack.
[0096] That is, it is determined whether the second execution result meets the expected execution result corresponding to the second instruction. If not, it means that it is not affected by the malicious code injection; if it meets, it means that it is affected by the malicious code injection, and it is recorded as a successful attack.
[0097] It should be understood that the expected execution result corresponding to the second instruction is set according to the attack purpose. For example, maliciously shutting down the device power is the attacker's expected result. If the second execution result meets the expected execution result corresponding to the second instruction, it is recorded as a successful attack.
[0098] Step 8: Repeat steps 2 to 7 several times to determine the false trigger rate (FTR) and the attack success rate (ASR). Perform weighted calculation on the false trigger rate (FTR) and the attack success rate (ASR) to obtain a vulnerability assessment value of the target embodied smart device.
[0099] During each repetition, the user can issue a different first and second command to comprehensively test the security of the target embodied smart device under different command conditions. After completing several tests, the number of false triggers and the number of successful attacks are counted. The false trigger rate is determined by the ratio of false triggers to the total number of tests, and the attack success rate is determined by the ratio of successful attacks to the total number of tests.
[0100] In one possible implementation, the false trigger rate FTR and the attack success rate ASR are weighted to obtain the vulnerability assessment value Score of the target embodied smart device, specifically:
[0101] Score=λ1ASR-λ2FTR,λ1+λ2=1 and 0≤λ1,λ2
[0102] Where λ1 and λ2 are the weight coefficients of attack success rate and false trigger rate, respectively.
[0103] It should be noted that the weight coefficient can be set according to actual needs. For example, if it is believed that a successful attack has a greater impact on system security, a higher weight can be given to the attack success rate.
[0104] It should be understood that if the target embodied intelligent device faces multiple task scenarios, then steps 2 to 7 are repeated in other scenarios to obtain a comprehensive vulnerability assessment value.
[0105] Through the above implementation methods, the present invention can effectively perform security testing on malicious injection of sample code for embodied intelligent systems and evaluate the vulnerability of target embodied intelligent devices, which is conducive to improving the security of embodied intelligent systems.
[0106] The present invention will be further explained below with reference to a simulation implementation case.
[0107] Specific assessment designs are conducted for four classic embodied intelligent robotic arm scenarios, such as discarding garbage, opening bottle caps, pressing switches, and pushing and pulling objects. These include a combination of basic behaviors such as grasping and prevention, rotation, pushing and pulling, etc. The goal is to provide a feasible and effective vulnerability assessment method for embodied intelligent devices driven by large language models.
[0108] Table 1 shows the security test results of the embodied intelligent robotic arm driven by a large model of the present invention in four task scenarios, namely: picking up and placing objects, clamping and rotating bottle caps, pressing buttons, and pushing and pulling objects. The attack paradigms used for testing include two injection attack forms: seven attack paradigms injected independently and two attack paradigms injected in combination. The experimental results show that the embodied intelligent system can complete the four types of tasks normally, but it has obvious vulnerabilities. The attack success rate used for testing reached 100% in the four task scenarios, whether it was an independent paradigm or a combination of paradigms, and did not affect the normal execution of the embodied intelligent system.
[0109] Table 1: Security test reports under seven attack paradigms and four scenarios.
[0110]
[0111] Figure 2 This video demonstrates a security test of an embodied intelligent robotic arm in a simulated environment, performing a pick-up and place task. The attack patterns used for this test were a combination of four attack patterns: sequence swapping, content replacement, amplitude change, and direction change. The green portion represents unmodified executable code, while the red text in the white portion represents modified executable code. The final results show that the combined attack pattern of the four attack patterns caused the embodied intelligent robotic arm to perform malicious actions during the security test, exposing the system's vulnerability during this process.
[0112] In another embodiment of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of a sample code malicious injection security testing method for an embodied intelligent system.
[0113] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the example code malicious injection security testing method for an embodied intelligent system in the above embodiment.
[0114] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0116] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0117] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0118] The present invention also provides a computer program product for executing any of the aforementioned methods for security testing of malicious code injection against an embodied intelligent system. Because the computer program product provided by the present invention and the aforementioned method for security testing of malicious code injection against an embodied intelligent system are based on the same inventive concept, the computer program product provided by the present invention possesses all the advantages of the aforementioned method for security testing of malicious code injection against an embodied intelligent system. Therefore, the beneficial effects of the computer program product provided by the present invention will not be detailed here.
[0119] In the present invention, the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0120] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-mentioned embodiments, ordinary technicians in this field should understand that any technician familiar with this technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered by the protection scope of the present invention.
Claims
1. A sample code malicious injection security testing method for embodied intelligent systems, characterized by: include: Step 1: Using a preset attack paradigm, malicious code is injected into the unmodified sample code list in the target embodied smart device to obtain a sample code list attacked by the malicious code; Step 2: The target embodied intelligent device receives a first instruction and sends the first instruction and a list of sample codes attacked by malicious code to a cloud-based large language model; the first instruction is characterized as a natural language instruction; Step 3: The target embodied intelligent device receives and executes the first executable code to obtain a first execution result; the first executable code is obtained by inference and calculation by a cloud-based large language model based on the first instruction and a list of example codes attacked by the malicious code; Step 4: Determine, in combination with the first executable code, whether the first execution result meets the expected execution result corresponding to the first instruction; if not, record it as a false trigger; Step 5: The target embodied intelligent device receives the second instruction and sends the second instruction and a list of sample codes attacked by the malicious code to the cloud-based large language model; the second instruction is characterized as a signal instruction that cannot be inferred for a specific purpose, or an instruction that combines a natural language instruction with a signal instruction; Step 6: The target embodied intelligent device receives and executes the second executable code to obtain a second execution result; the second executable code is obtained by inference and calculation by the cloud-based large language model based on the second instruction and the list of example codes attacked by the malicious code; Step 7: Determine whether the second execution result matches the expected execution result corresponding to the second instruction in combination with the second executable code. If so, record the result as a successful attack. Step 8: Repeat steps 2 to 7 several times to determine the false trigger rate and attack success rate, and perform weighted calculation on the false trigger rate and attack success rate to obtain the vulnerability assessment value of the target embodied smart device.
2. A sample code malicious injection security testing method for embodied intelligent systems according to claim 1, characterized in that: The preset attack paradigm is used to inject malicious code into the untampered sample code list in the target embodied smart device to obtain the sample code list attacked by the malicious code, specifically: Where D T A list of sample codes that are attacked by malicious code; D is a list of unmodified sample codes; The second instruction in the example code list that is attacked by malicious code; is the malicious code corresponding to the second instruction in the sample code list attacked by malicious code; M is the number of malicious codes injected in the untampered sample code list; N is the total number of steps in the executable code block; A d The executable code block in the unmodified sample code list; a i is the i-th step in the executable code block; j is the j-th step; k is the k-th step; The preset attack paradigm includes at least one of a sequence exchange operation, a step addition operation, a content replacement operation, a step missing operation, an amplitude change operation, a direction change operation, and a step differential operation.
3. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The sequence exchange operation is specifically as follows: Where, Malicious code injected using sequence exchange as the attack paradigm.
4. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The adding step is specifically as follows: Where, is the malicious code injected using the add step attack pattern; r is the rth step; q is the qth step.
5. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The content replacement operation is specifically as follows: Where, is the malicious code injected using content replacement as the attack paradigm; r is the rth step; q is the qth step.
6. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The missing steps are as follows: Where, Malicious code injected using the missing steps attack paradigm.
7. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The amplitude change operation is specifically as follows: Where, is the malicious code injected with amplitude variation as the attack paradigm; λ is an arbitrary real number.
8. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The direction change operation is specifically as follows: Where, Malicious code injected using direction change as the attack paradigm.
9. The method for security testing of malicious injection of sample code for embodied intelligent systems according to claim 2, characterized in that: The differential operation of the steps is specifically as follows: Where, It is a malicious code injected using step differentiation as the attack paradigm.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the example code malicious injection security testing method for an embodied intelligent system as described in any one of claims 1 to 9 is implemented.