Security-Relevant Code Detection via ML Vector Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The software industry faces challenges in maintaining a secure software supply chain due to the lack of consistent, comprehensive, and accurate sources of open-source software (OSS) vulnerability information, particularly the National Vulnerability Database (NVD) not providing detailed information on how vulnerabilities are fixed at the code level, leading to difficulties in patching security issues.

Innovation Solution

A method using machine-learning techniques to extract security-relevant code changes directly from source code repositories, treating code changes as ordinary text and applying automated text-classification methods to identify security-relevant patches, employing classifiers like Logistic Regression and Support Vector Machines to distinguish between security-relevant and non-security relevant changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If traditional vulnerability databases like NVD are used as the primary source of security information, then vulnerability information is available through established channels, but detailed information about code-level security fixes and patching instructions is lacking

Engineering Contradiction:
Improvesecurity fix informationVSAvoidcode-level detail accuracy
Core Design Contradiction:
Loss of informationVSMeasurement precision

Solution Approach 1:

The patent introduces an intermediary system that bridges vulnerability databases and code repositories. This intermediary automatically retrieves source code from repositories, analyzes commits to identify security fixes, and enriches vulnerability records with precise code-level information including file paths, line numbers, and diff data, thereby resolving the information gap without requiring manual intervention

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by proactively monitoring and analyzing code commits in real-time as they are pushed to repositories. By pre-processing and indexing commit data before vulnerabilities are reported, the system ensures that when a vulnerability is discovered, the corresponding code-level fix information is already available and can be immediately associated with the vulnerability record

Inventive Principle:
Principle #10Preliminary action

2Productivity

If OSS projects commit code changes directly to repositories without issuing advisories, then development speed is maintained, but security vulnerability information becomes difficult to detect and assess

Engineering Contradiction:
Improvedevelopment speedVSAvoidsecurity fix detection
Core Design Contradiction:
ProductivityVSDifficulty of detecting and measuring

Solution Approach 1:

The system enables self-service by automatically performing security analysis functions that would otherwise require manual security advisories. It autonomously retrieves commits, analyzes code changes using machine learning models, identifies security fixes, and generates structured security information without human intervention, allowing OSS projects to maintain their rapid development pace while still providing security transparency

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system establishes a feedback loop where code commits are automatically analyzed and security-relevant changes are detected and reported back to vulnerability management systems. This continuous feedback mechanism transforms the silent code commit process into an informative security monitoring system, enabling automatic detection of security fixes without disrupting the development workflow

Inventive Principle:
Principle #23Feedback

3Measurement precision

If manual methods are used to track and analyze code changes for security vulnerabilities, then detailed security analysis can be performed, but the process is time-consuming and inefficient

Engineering Contradiction:
Improvesecurity analysis accuracyVSAvoidvulnerability management time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent replaces manual mechanical analysis with automated machine learning-based analysis. Machine learning models are trained to recognize patterns indicative of security fixes in code commits, automatically classifying and extracting security-relevant information. This substitution maintains high accuracy in security analysis while eliminating the time-consuming nature of manual review, enabling scalable vulnerability management

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS10831899B2Security-relevant code detection system
Publication Date: 2020.11.10 SAP SE
  • US10831899B2 patent drawing
  • US10831899B2 patent drawing
  • US10831899B2 patent drawing

AI summary

Systems and methods are provided for retrieving a set of code changes to source code from a source code repository, analyzing the set of code changes to generate a vector representation of each code change of the set of code changes, analyzing the vector representation of each code change of the set of code changes using a trained security-relevant code detection machine learning model, receiving a prediction from the security-relevant code detection machine learning model representing a probability that each code change of the set of code changes contains security-relevant changes, analyzing the prediction to determine whether the prediction is below or above a predetermined threshold, and generating results based on determining whether the prediction is below or above a predetermined threshold.