Patent ID: 11880470
Assignee: WHITESOURCE LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 17:
18. A computer program product comprising a non-transitory computer readable medium retaining program instructions, which instructions when read by a processor, cause the processor to perform:
obtaining user code;
obtaining an indication of at least one vulnerability, the vulnerability associated with at least one set comprising at least a first instruction type and a second instruction type, wherein the first instruction type is a source type and the second instruction type is a sink type;
scanning the code using dependency analysis, to obtain for the at least one set:
at least one first instruction of the first instruction type,
at least one second instruction of the second instruction type, and
further instructions associated with entities relevant to the first instruction and the second instruction,.

wherein scanning the code comprises:

identifying a sink within the user code;
forward scanning the user code from the sink and eliminating at least one instruction not dependent upon the sink; and

backward scanning the user code from the sink to detect at least one source, leaving only instructions on which the sink is dependent;

eliminating instructions other than the at least one first instruction, the at least one second instruction and at least one of the further instructions, thereby obtaining a collection of instructions that behaves differently from the user code; and
providing the collection of instructions for vulnerability detection.