SlideShare a Scribd company logo
1 of 264
Download to read offline
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher
to
Eliminate OSS Vulnerabilities
Once and for All
- Jonathan Leitschuh -
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher
to
Eliminate OSS Vulnerabilities
Once and for All
- Jonathan Leitschuh -
- Patrick Way -
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
- Jonathan Leitschuh -
Software Engineer & Security Researcher
Dan Kaminsky Fellowship @ HUMAN Security
GitHub Star & GitHub Security Ambassador
Twitter: @JLLeitschuh
GitHub: JLLeitschuh
🐳
Hello!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
- Patrick Way -
Senior Software Engineer
OpenRewrite Team @ Moderne
Twitter: @WayPatrick
GitHub: pway99
Hello!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Disclaimer
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Supported by
The
Dan Kaminsky Fellowship
at
HUMAN Security
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Chester Higgins/The New York Times
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Spoilers!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
152 Pull Requests!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
It Started
With a Simple Vulnerability
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
HTTP Download of Dependencies in the Java Ecosystem
// build.gradle
maven {
setUrl("http://dl.bintray.com/kotlin/ktor")
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Why is HTTPS important?
13
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
HTTP Download of Dependencies in the Java Ecosystem
<!-- Compiler & Test Dependencies -->
<repositories>
<repository>
<id>example-id</id>
<name>Example insecure repository</name>
<url>http://[SOME URL HERE]</url>
</repository>
</repositories>
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
HTTP Download of Dependencies in the Java Ecosystem
<!-- Artifact upload - Credentials!! -->
<distributionManagement>
<repository>
<id>example-id</id>
<name>Example insecure repository</name>
<url>http://[SOME URL HERE]</url>
</repository>
</distributionManagement>
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
This Vulnerability was Everywhere!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Who else was vulnerable?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
“25% of Sonatype Maven
Central downloads are still
using HTTP”
- Sonatype June 2019 -
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
How do we fix this?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Decommissioning HTTP Support
On or around January 15th, 2020
● Maven Central (Sonatype)
● JCenter (JFrog)
● Spring (Pivotal)
● Gradle Plugin Portal (Gradle)
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
However!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
“20% of Sonatype Maven
Central Traffic is STILL using
HTTP”
- Sonatype January 2020 -
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
You can imagine what happened...
January 15th, 2020
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We stopped the bleeding
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
What about the other repositories?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Only the most commonly used repositories
● Maven Central (Sonatype)
● JCenter (JFrog)
● Spring (Pivotal)
● Gradle Plugin Portal (Gradle)
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
How do we fix the rest?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Bulk Pull Request Generation!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
How?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
import java
import semmle.code.xml.MavenPom
private class DeclaredRepository extends PomElement {
DeclaredRepository() {
this.getName() = "repository" or
this.getName() = "snapshotRepository" or
this.getName() = "pluginRepository"
}
string getUrl() { result = getAChild("url").(PomElement).getValue() }
predicate isInsecureRepositoryUsage() {
getUrl().matches("http://%") or
getUrl().matches("ftp://%")
}
}
from DeclaredRepository repository
where repository.isInsecureRepositoryUsage()
select repository,
"Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " +
repository.getUrl()
CodeQL
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL scans 100Ks of OSS Projects
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
import java
import semmle.code.xml.MavenPom
private class DeclaredRepository extends PomElement {
DeclaredRepository() {
this.getName() = "repository" or
this.getName() = "snapshotRepository" or
this.getName() = "pluginRepository"
}
string getUrl() { result = getAChild("url").(PomElement).getValue() }
predicate isInsecureRepositoryUsage() {
getUrl().matches("http://%") or
getUrl().matches("ftp://%")
}
}
from DeclaredRepository repository
where repository.isInsecureRepositoryUsage()
select repository,
"Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " +
repository.getUrl()
CodeQL
$2,300 Bounty
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request
Generator
Version 1
● Python Based
● Wrapper over ‘hub’ CLI
● One Nasty Regular
Expression
● Bouncing off GitHub’s
rate limiter
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
It worked!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
HTTP Download of Dependencies
1,596
Pull Requests
~40%
Merged or Accepted
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
$4,000
Thanks to the GitHub Security Lab!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
There’s more still out there
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
More Pull Request Generation
For this in the Future!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
I got hooked on
Bulk Pull Request Generation
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
I have a Problem
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
I was finding too many security vulnerabilities!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
I was finding too many security vulnerabilities!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
I was finding too many security vulnerabilities!
I needed automation!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Automated Accurate Transformations
at a
Massive Scale
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
OpenRewrite
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Abstract Syntax Tree (AST)
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Abstract Syntax Tree (AST)
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Format Preserving AST
Whitespace and comments are preserved
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Tabs
Spaces
Braces on new line
Generated code matches the Surrounding Formatting
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
log.info("...");
Is that log4j, slf4j, LogBack?
Accurate Transformations Require
Fully Type-attributed ASTs
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
The OpenRewrite AST is both
Syntactically and Semantically aware.
With type attribution and formatting
Syntax alone
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Even simple code produces complex AST
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Even simple code produces complex AST
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
With the ability to Transform Code
How can we transform source files while
preserving the style?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Open Rewrite
● Automatically Detects the the Code Style
during Parsing
● Provides a Templating Engine to add New
Source Code
● Auto-format applies the detected style
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Transform ASTs using AutoFormat and the JavaTemplate
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Easily transform ASTs using AutoFormat and the JavaTemplate
String template =
"if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new
RuntimeException("Bad zip entry");}"
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Easily transform ASTs using AutoFormat and the JavaTemplate
String template =
"if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new
RuntimeException("Bad zip entry");}"
block = maybeAutoFormat(
block, block.withTemplate(JavaTemplate.builder(this::getCursor, template).build(),
resolvePathStatement.getCoordinates().after(),
zipEntryArg, parentDirArg),
ctx);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Easily transform ASTs using AutoFormat and the JavaTemplate
JavaTemplate template = JavaTemplate.builder(this::getCursor,
"if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new
RuntimeException("Bad zip entry");}").build();
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Easily transform ASTs using AutoFormat and the JavaTemplate
JavaTemplate template = JavaTemplate.builder(this::getCursor,
"if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new
RuntimeException("Bad zip entry");}").build();
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Data and Control flow are new additions to
rewrite….
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
What is possible now?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
What other vulnerabilities can we fix?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Three Vulnerabilities
1. Temporary Directory Hijacking
2. Partial Path Traversal
3. Zip Slip
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Vulnerability #1
Temporary Directory Hijacking
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory on
Unix-Like Systems is
Shared between All Users
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Vulnerable
File f = File.createTempFile(
"prefix",
"suffix"
);
f.delete();
f.mkdir();
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Vulnerable
File f = File.createTempFile(
"prefix",
"suffix"
);
f.delete();
f.mkdir();
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Vulnerable
File f = File.createTempFile(
"prefix",
"suffix"
);
f.delete();
// 🏁 Race condition
f.mkdir(); // Returns `false`
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Imperfect Fix
File f = File.createTempFile(
"prefix",
"suffix"
);
f.delete();
if(!f.mkdir())
throw new IOException("Error");
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Fix
// Since Java 1.7
File f =
Files
.createTempDirectory("prefix")
.toFile();
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - CVEs
● CVE-2022-27772 - Spring Boot
● CVE-2021-20202 - Keycloak
● CVE-2021-21331 - DataDog API
● CVE-2020-27216 - Eclipse Jetty
● CVE-2020-17521 - Apache Groovy
● CVE-2020-17534 - Apache netbeans-html4j
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking
Pull Request Statistics
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking
64 Pull Requests!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Pull Requests
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Temporary Directory Hijacking - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Vulnerability #2
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
"/user/sam"
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
"/user/sam"
"/user/samantha"
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Allows an attacker access to a sibling
directory with the same prefix
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Allows an attacker access to a sibling
directory with the same prefix
"/user/sam"
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Allows an attacker access to a sibling
directory with the same prefix
"/user/sam"
"/user/samantha"
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Allows an attacker access to a sibling
directory with the same prefix
"/user/sam"
"/user/samantha"
Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
parent, userControlled()
);
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
throw new IOException(
"Detected path traversal attack!"
);
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
new File("/user/sam/")
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
new File("/user/sam/")
File.getCanonicalPath()
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
new File("/user/sam/")
File.getCanonicalPath()
"/user/sam"
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
new File("/user/sam/")
File.getCanonicalPath()
"/user/sam"
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
parent, userControlled()
);
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
throw new IOException(
"Detected path traversal attack!"
);
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
"/user/sam/", userControlled()
);
if (!dir.getCanonicalPath()
.startsWith("/user/sam")) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
"/user/sam/", "../samantha/baz"
);
if (!dir.getCanonicalPath()
.startsWith("/user/sam")) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
"/user/sam/", "../samantha/baz"
);
if (!"/user/samantha/baz"
.startsWith("/user/sam")) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
"/user/sam/", "../samantha/baz"
);
if (!"/user/samantha/baz"
.startsWith("/user/sam")) {
throw new IOException(
"Detected path traversal attack!"
);
}
❌
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal
Fix!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
parent, userControlled()
);
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
throw new IOException(
"Detected path traversal attack!"
);
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Fix #1
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath() +
File.separatorChar)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Fix #2
if (!dir.getCanonicalFile()
.toPath().startsWith(
parent.getCanonicalFile().toPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Fix #2 - Better
if (!dir.getCanonicalFile()
.toPath().startsWith(
parent.getCanonicalFile().toPath())) {
...
} ✅
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
How do we find this vulnerability?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
File dir = new File(
parent, userControlled()
);
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
throw new IOException(
"Detected path traversal attack!"
);
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Safe
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath() +
File.separatorChar)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
It can’t be that easy, can it?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
String dirCanonical = dir.getCanonicalPath();
if (!dirCanonical
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath();
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Vulnerability
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We need Data Flow Analysis
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - DataFlow
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Data Flow
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Data Flow
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Data Flow
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
if (!dirCanonical
.startsWith(pCanonical)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Data Flow
String dirCanonical = dir.getCanonicalPath();
String pCanonical = parent.getCanonicalPath() +
File.separatorChar;
String pCanonical2 = pCanonical;
if (!dirCanonical
.startsWith(pCanonical2)) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Data Flow
Uncovers hard to find Vulnerabilities
and prevents
False Positives
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Data Flow Analysis
class GetCanonicalPathToStartsWithLocalFlowextends LocalFlowSpec<J.MethodInvocation
, Expression> {
@Override
public boolean isSource(J.MethodInvocation methodInvocation, Cursor cursor) {
return new MethodMatcher(
"java.io.File getCanonicalPath()"
)
.matches(
methodInvocation);
}
@Override
public boolean isSink(Expression expression, Cursor cursor) {
return InvocationMatcher
.
fromMethodMatcher(
new MethodMatcher(
"java.lang.String startsWith(java.lang.String)"
)
)
.advanced()
.isSelect(
cursor);
}
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Partial Path Traversal - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Example Case: AWS Java SDK
CVE-2022-31159
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Vulnerability Disclosure Drama!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Aside: Email with AWS Security Team
AWS: We’d like to award you a bug bounty, however you’d need
to sign an NDA.
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Aside: Email with AWS Security Team
AWS: We’d like to award you a bug bounty, however you’d need
to sign an NDA.
Jonathan: I don’t normally agree to NDA’s. Can I read it first
before potentially agreeing?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Aside: Email with AWS Security Team
AWS: We’d like to award you a bug bounty, however you’d need
to sign an NDA.
Jonathan: I don’t normally agree to NDA’s. Can I read it first
before potentially agreeing?
AWS: We’re unable to share the bug bounty program NDA since
it and other contract documents are considered sensitive by the
legal team.
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Vulnerability #3
Zip Slip
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
Path Traversal Vulnerability
while
Unpacking Zip File Entries
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
void zipSlip(File destination, ZipFile zip) {
Enumeration<? extends ZipEntry> entries = zip.entries();
while (entries.hasMoreElements()) {
ZipEntry e = entries.nextElement();
File f = new File(destination, e.getName());
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
}
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = entries.nextElement();
File f = new File(destination, e.getName());
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip is Complicated
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = ...
File f = new File(destination, e.getName());
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = ...
File f = new File(destination, e.getName());
if (!f.toPath().startsWith(destination.toPath())) {
throw new IOException("Bad Zip Entry!");
}
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
The Problem
with
Zip Slip
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = ...
File f = new File(destination, e.getName());
if (!f.toPath().startsWith(destination.toPath())) {
throw new IOException("Bad Zip Entry!");
}
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = ...
File f = new File(destination, e.getName());
if (f.toPath().startsWith(destination.toPath())) {
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Control Flow Analysis
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Control Flow Analysis
File f = new File(destination, e.getName());
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
File f = new File(destination, e.getName());
if (!f.toPath().startsWith(destination.toPath())){
throw new IOException("Bad Zip Entry!");
}
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Control Flow - OpenRewrite
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
ZipEntry e = ...
File f = new File(destination, e.getName());
if (!f.toPath().startsWith(destination.toPath())) {
throw new IOException("Bad Zip Entry!");
}
IOUtils.copy(
zip.getInputStream(e),
new FileOutputStream(f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip
File f = new File(destination, e.getName());
if (!f.toPath().startsWith(
destination.toPath())) {
throw new IOException("Bad Zip Entry!"
);
}
IOUtils.copy(
zip.getInputStream(
e),
new FileOutputStream(
f)
);
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Zip Slip - Putting it all together
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Problems with Pull Request Generation
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
How fast can we generate
Pull Requests?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
File IO Git Operation GitHub API .
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Pull Request Generation Steps
1. Checkout (ie. Download) code Repository
2. Branch, Apply Diff, & Commit
3. Fork Repository on GitHub
4. Rename Repository on GitHub
5. Push changes
6. Create Pull Request on GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Let’s talk about...
GitHub’s API Rate Limiter
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Github Documentation
“If you're making a large number of POST, PATCH, PUT,
or DELETE requests for a single user or client ID, wait at
least one second between each request.”
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Github Documentation
“When you have been limited, use the Retry-After
response header to slow down. The value of the
Retry-After header will always be an integer,
representing the number of seconds you should wait
before making requests again.”
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Something New Appeared in 2022
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Github Documentation
“Requests that create content which triggers notifications,
such as issues, comments and pull requests, may be
further limited and will not include a Retry-After
header in the response. Please create this content at a
reasonable pace to avoid further limiting.”
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Github Documentation
“Requests that create content which triggers notifications,
such as issues, comments and pull requests, may be
further limited and will not include a Retry-After
header in the response. Please create this content at a
reasonable pace to avoid further limiting.”
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Github Documentation
“Requests that create content which triggers notifications,
such as issues, comments and pull requests, may be
further limited and will not include a Retry-After
header in the response. Please create this content at a
reasonable pace to avoid further limiting.”
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We’ve made it this far
✅ Vulnerabilities Detected
✅ Style Detected
✅ Code Fixed & Diff Generated
✅ Rate Limit Bypassed
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We’ve made it this far
✅ Vulnerabilities Detected
✅ Style Detected
✅ Code Fixed & Diff Generated
✅ Rate Limit Bypassed
How do we do this for all the repositories?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Moderne
● Free for Open Source Projects!
● ~7,000 Repositories indexed
● Run Open Rewrite Transformations at Scale
● Generates and Updates Pull Requests
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
800+ OpenRewrite Recipes including complete
Framework Migrations
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
It’s not just your code that needs to be secure
It’s also the dependencies
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
800+ OpenRewrite Recipes including complete
Framework Migrations
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Bulk Pull Request Generation - public.moderne.io
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
But there are more than just 7,000
repositories in the world
How do we find the other vulnerable projects?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL
100k+ OSS Projects Indexed
35k+ OSS Java Projects
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
https://github.com/moderneinc/jenkins-ingest
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
if (!dir.getCanonicalPath()
.startsWith(parent.getCanonicalPath())) {
...
}
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
With the list of vulnerable projects in hand!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Finally!
Let’s generate some
Open Source Software
Pull Requests!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Bulk Pull Request Generation Statistics
Project PR Generator Pull Requests Merge Rate
HTTP Download of Dependencies Python Bot 1,596 40%
CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3%
CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6%
Temporary Directory Hijacking Moderne 64 25%
Partial Path Traversal Moderne 50 22%
Zip Slip Moderne 152 20%
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Bulk Pull Request Generation Statistics
Project PR Generator Pull Requests Merge Rate
HTTP Download of Dependencies Python Bot 1,596 40%
CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3%
CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6%
Temporary Directory Hijacking Moderne 64 25%
Partial Path Traversal Moderne 50 22%
Zip Slip Moderne 152 20%
New Pull Requests Generated in 2022: 600+
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Bulk Pull Request Generation Statistics
Project PR Generator Pull Requests Merge Rate
HTTP Download of Dependencies Python Bot 1,596 40%
CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3%
CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6%
Temporary Directory Hijacking Moderne 64 25%
Partial Path Traversal Moderne 50 22%
Zip Slip Moderne 152 20%
Personally Generated: 5,200+ Pull Requests
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Best Practices for Bulk Pull Request
Generation
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Messaging!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
All Software Problems are
People Problems
In Disguise
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 1
Sign off all Commits
--signoff
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Sign off on Commits
Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Sign off on Commits
Why?!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Sign off on Commits
“It was introduced in the wake of the SCO lawsuit, (and other accusations of
copyright infringement from SCO, most of which they never actually took to court),
as a Developers Certificate of Origin. It is used to say that you certify that you
have created the patch in question, or that you certify that to the best of your
knowledge, it was created under an appropriate open-source license, or that it has
been provided to you by someone else under those terms.”
- Stack Overflow
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
TL;DR
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lawyers
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 2
Be a good commitizen
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 2
Be a good commitizen
GPG Sign your Commits
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 3
SECOM
Commit Format
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
SECOM
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 4
There are risks using your
personal
GitHub Account
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Anyone here familiar with
GitHub’s
Angry Unicorn?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
This was my GitHub Profile Page for most of 2020
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Remember GitHub’s Rate Limit?
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 5
Coordinate with GitHub
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Before Attempting
Reach out to GitHub!
SecurityLab@github.com
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Lesson 6
Consider the Implications
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Conclusion
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
As Security Researchers
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We have an obligation to society
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
We know these vulnerabilities are out there
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
“For every 500 developers
you have one security
researcher.”
- GitHub 2020
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
- Dan Kaminsky (1979 – 2021)
“We can fix it. We have the technology. OK. We need
to create the technology. Alright. The policy guys are
mucking with the technology. Relax. WE'RE ON IT.
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
● Learn CodeQL! Seriously! It’s an incredibly powerful language!
● Contribute to OpenRewrite! Deploy your security fixes at scale!
● Join the GitHub Security Lab & OpenRewrite Slack Channels!
● Join the Open Source Security Foundation (OSSF)!
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Thanks
Lidia Giuliano
Shyam Mehta
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
@JLLeitschuh
Jonathan.Leitschuh@gmail.com
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal
Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
CodeQL: Partial Path Traversal

More Related Content

Similar to [cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All by Jonathan Leitschuh

The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDJames Wickett
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline SecurityJames Wickett
 
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxModern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxC4Media
 
Geecon 2017 Anatomy of Java Vulnerabilities
Geecon 2017 Anatomy of Java VulnerabilitiesGeecon 2017 Anatomy of Java Vulnerabilities
Geecon 2017 Anatomy of Java VulnerabilitiesSteve Poole
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD PipelineJames Wickett
 
The DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD PipelineThe DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD PipelineJames Wickett
 
The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDJames Wickett
 
Work with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec CaliforniaWork with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec Californialeifdreizler
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspectiveSecuRing
 
Maturing DevSecOps: From Easy to High Impact
Maturing DevSecOps: From Easy to High ImpactMaturing DevSecOps: From Easy to High Impact
Maturing DevSecOps: From Easy to High ImpactSBWebinars
 
(java2days) The Anatomy of Java Vulnerabilities
(java2days) The Anatomy of Java Vulnerabilities(java2days) The Anatomy of Java Vulnerabilities
(java2days) The Anatomy of Java VulnerabilitiesSteve Poole
 
OpenStack Security Project
OpenStack Security ProjectOpenStack Security Project
OpenStack Security ProjectTravis McPeak
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Velocity 2015 Amsterdam: Alerts overload
Velocity 2015 Amsterdam: Alerts overloadVelocity 2015 Amsterdam: Alerts overload
Velocity 2015 Amsterdam: Alerts overloadsarahjwells
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Matt Raible
 
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics Methods
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics MethodsSplunk Discovery: Warsaw 2018 - Intro to Security Analytics Methods
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics MethodsSplunk
 
SplunkLive! Frankfurt 2018 - Intro to Security Analytics Methods
SplunkLive! Frankfurt 2018 - Intro to Security Analytics MethodsSplunkLive! Frankfurt 2018 - Intro to Security Analytics Methods
SplunkLive! Frankfurt 2018 - Intro to Security Analytics MethodsSplunk
 
BSidesLV -The SOC Counter ATT&CK
BSidesLV -The SOC Counter ATT&CKBSidesLV -The SOC Counter ATT&CK
BSidesLV -The SOC Counter ATT&CKMathieu Saulnier
 
CONFidence 2014:
CONFidence 2014: CONFidence 2014:
CONFidence 2014: PROIDEA
 

Similar to [cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All by Jonathan Leitschuh (20)

The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CD
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxModern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
 
ISC2: AppSec & OWASP Primer
ISC2: AppSec & OWASP PrimerISC2: AppSec & OWASP Primer
ISC2: AppSec & OWASP Primer
 
Geecon 2017 Anatomy of Java Vulnerabilities
Geecon 2017 Anatomy of Java VulnerabilitiesGeecon 2017 Anatomy of Java Vulnerabilities
Geecon 2017 Anatomy of Java Vulnerabilities
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD Pipeline
 
The DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD PipelineThe DevSecOps Builder’s Guide to the CI/CD Pipeline
The DevSecOps Builder’s Guide to the CI/CD Pipeline
 
The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CD
 
Work with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec CaliforniaWork with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec California
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspective
 
Maturing DevSecOps: From Easy to High Impact
Maturing DevSecOps: From Easy to High ImpactMaturing DevSecOps: From Easy to High Impact
Maturing DevSecOps: From Easy to High Impact
 
(java2days) The Anatomy of Java Vulnerabilities
(java2days) The Anatomy of Java Vulnerabilities(java2days) The Anatomy of Java Vulnerabilities
(java2days) The Anatomy of Java Vulnerabilities
 
OpenStack Security Project
OpenStack Security ProjectOpenStack Security Project
OpenStack Security Project
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Velocity 2015 Amsterdam: Alerts overload
Velocity 2015 Amsterdam: Alerts overloadVelocity 2015 Amsterdam: Alerts overload
Velocity 2015 Amsterdam: Alerts overload
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
 
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics Methods
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics MethodsSplunk Discovery: Warsaw 2018 - Intro to Security Analytics Methods
Splunk Discovery: Warsaw 2018 - Intro to Security Analytics Methods
 
SplunkLive! Frankfurt 2018 - Intro to Security Analytics Methods
SplunkLive! Frankfurt 2018 - Intro to Security Analytics MethodsSplunkLive! Frankfurt 2018 - Intro to Security Analytics Methods
SplunkLive! Frankfurt 2018 - Intro to Security Analytics Methods
 
BSidesLV -The SOC Counter ATT&CK
BSidesLV -The SOC Counter ATT&CKBSidesLV -The SOC Counter ATT&CK
BSidesLV -The SOC Counter ATT&CK
 
CONFidence 2014:
CONFidence 2014: CONFidence 2014:
CONFidence 2014:
 

More from CODE BLUE

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...CODE BLUE
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten NohlCODE BLUE
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo PupilloCODE BLUE
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫CODE BLUE
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...CODE BLUE
 
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka CODE BLUE
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...CODE BLUE
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...CODE BLUE
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...CODE BLUE
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...CODE BLUE
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也CODE BLUE
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...CODE BLUE
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...CODE BLUE
 

More from CODE BLUE (20)

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
 
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
 

Recently uploaded

Motivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfMotivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfakankshagupta7348026
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfhenrik385807
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptxBasil Achie
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...NETWAYS
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...NETWAYS
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 

Recently uploaded (20)

Motivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdfMotivation and Theory Maslow and Murray pdf
Motivation and Theory Maslow and Murray pdf
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdfCTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
CTAC 2024 Valencia - Henrik Hanke - Reduce to the max - slideshare.pdf
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 

[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All by Jonathan Leitschuh

  • 1. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and for All - Jonathan Leitschuh -
  • 2. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and for All - Jonathan Leitschuh - - Patrick Way -
  • 3. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh - Jonathan Leitschuh - Software Engineer & Security Researcher Dan Kaminsky Fellowship @ HUMAN Security GitHub Star & GitHub Security Ambassador Twitter: @JLLeitschuh GitHub: JLLeitschuh 🐳 Hello!
  • 4. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh - Patrick Way - Senior Software Engineer OpenRewrite Team @ Moderne Twitter: @WayPatrick GitHub: pway99 Hello!
  • 5. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Disclaimer
  • 6. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Supported by The Dan Kaminsky Fellowship at HUMAN Security
  • 7. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Chester Higgins/The New York Times
  • 8. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Spoilers!
  • 9. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 10. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip 152 Pull Requests!
  • 11. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh It Started With a Simple Vulnerability
  • 12. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh HTTP Download of Dependencies in the Java Ecosystem // build.gradle maven { setUrl("http://dl.bintray.com/kotlin/ktor") }
  • 13. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Why is HTTPS important? 13
  • 14. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh HTTP Download of Dependencies in the Java Ecosystem <!-- Compiler & Test Dependencies --> <repositories> <repository> <id>example-id</id> <name>Example insecure repository</name> <url>http://[SOME URL HERE]</url> </repository> </repositories>
  • 15. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh HTTP Download of Dependencies in the Java Ecosystem <!-- Artifact upload - Credentials!! --> <distributionManagement> <repository> <id>example-id</id> <name>Example insecure repository</name> <url>http://[SOME URL HERE]</url> </repository> </distributionManagement>
  • 16. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh This Vulnerability was Everywhere!
  • 17. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 18. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Who else was vulnerable?
  • 19. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh “25% of Sonatype Maven Central downloads are still using HTTP” - Sonatype June 2019 -
  • 20. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh How do we fix this?
  • 21. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Decommissioning HTTP Support On or around January 15th, 2020 ● Maven Central (Sonatype) ● JCenter (JFrog) ● Spring (Pivotal) ● Gradle Plugin Portal (Gradle)
  • 22. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 23. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh However!
  • 24. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh “20% of Sonatype Maven Central Traffic is STILL using HTTP” - Sonatype January 2020 -
  • 25. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh You can imagine what happened... January 15th, 2020
  • 26. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 27. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We stopped the bleeding
  • 28. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh What about the other repositories?
  • 29. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Only the most commonly used repositories ● Maven Central (Sonatype) ● JCenter (JFrog) ● Spring (Pivotal) ● Gradle Plugin Portal (Gradle)
  • 30. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh How do we fix the rest?
  • 31. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Bulk Pull Request Generation!
  • 32. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh How?
  • 33. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh import java import semmle.code.xml.MavenPom private class DeclaredRepository extends PomElement { DeclaredRepository() { this.getName() = "repository" or this.getName() = "snapshotRepository" or this.getName() = "pluginRepository" } string getUrl() { result = getAChild("url").(PomElement).getValue() } predicate isInsecureRepositoryUsage() { getUrl().matches("http://%") or getUrl().matches("ftp://%") } } from DeclaredRepository repository where repository.isInsecureRepositoryUsage() select repository, "Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " + repository.getUrl() CodeQL
  • 34. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL scans 100Ks of OSS Projects
  • 35. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh import java import semmle.code.xml.MavenPom private class DeclaredRepository extends PomElement { DeclaredRepository() { this.getName() = "repository" or this.getName() = "snapshotRepository" or this.getName() = "pluginRepository" } string getUrl() { result = getAChild("url").(PomElement).getValue() } predicate isInsecureRepositoryUsage() { getUrl().matches("http://%") or getUrl().matches("ftp://%") } } from DeclaredRepository repository where repository.isInsecureRepositoryUsage() select repository, "Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository " + repository.getUrl() CodeQL $2,300 Bounty
  • 36. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generator Version 1 ● Python Based ● Wrapper over ‘hub’ CLI ● One Nasty Regular Expression ● Bouncing off GitHub’s rate limiter
  • 37. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 38. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 39. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 40. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh It worked!
  • 41. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 42. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 43. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh HTTP Download of Dependencies 1,596 Pull Requests ~40% Merged or Accepted
  • 44. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh $4,000 Thanks to the GitHub Security Lab!
  • 45. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh There’s more still out there
  • 46. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 47. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 48. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh More Pull Request Generation For this in the Future!
  • 49. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh I got hooked on Bulk Pull Request Generation
  • 50. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 51. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh I have a Problem
  • 52. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 53. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh I was finding too many security vulnerabilities!
  • 54. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 55. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh I was finding too many security vulnerabilities!
  • 56. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh I was finding too many security vulnerabilities! I needed automation!
  • 57. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Automated Accurate Transformations at a Massive Scale
  • 58. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh OpenRewrite
  • 59. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Abstract Syntax Tree (AST)
  • 60. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Abstract Syntax Tree (AST)
  • 61. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Format Preserving AST Whitespace and comments are preserved
  • 62. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Tabs Spaces Braces on new line Generated code matches the Surrounding Formatting
  • 63. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh log.info("..."); Is that log4j, slf4j, LogBack? Accurate Transformations Require Fully Type-attributed ASTs
  • 64. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh The OpenRewrite AST is both Syntactically and Semantically aware. With type attribution and formatting Syntax alone
  • 65. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Even simple code produces complex AST
  • 66. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Even simple code produces complex AST
  • 67. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 68. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh With the ability to Transform Code How can we transform source files while preserving the style?
  • 69. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Open Rewrite ● Automatically Detects the the Code Style during Parsing ● Provides a Templating Engine to add New Source Code ● Auto-format applies the detected style
  • 70. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 71. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Transform ASTs using AutoFormat and the JavaTemplate
  • 72. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Easily transform ASTs using AutoFormat and the JavaTemplate String template = "if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new RuntimeException("Bad zip entry");}"
  • 73. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Easily transform ASTs using AutoFormat and the JavaTemplate String template = "if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new RuntimeException("Bad zip entry");}" block = maybeAutoFormat( block, block.withTemplate(JavaTemplate.builder(this::getCursor, template).build(), resolvePathStatement.getCoordinates().after(), zipEntryArg, parentDirArg), ctx);
  • 74. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Easily transform ASTs using AutoFormat and the JavaTemplate JavaTemplate template = JavaTemplate.builder(this::getCursor, "if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new RuntimeException("Bad zip entry");}").build();
  • 75. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Easily transform ASTs using AutoFormat and the JavaTemplate JavaTemplate template = JavaTemplate.builder(this::getCursor, "if(!#{any(java.nio.file.Path)}.normalize().startsWith(#{any(java.nio.file.Path)})){throw new RuntimeException("Bad zip entry");}").build();
  • 76. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 77. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 78. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 79. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Data and Control flow are new additions to rewrite….
  • 80. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh What is possible now?
  • 81. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh What other vulnerabilities can we fix?
  • 82. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Three Vulnerabilities 1. Temporary Directory Hijacking 2. Partial Path Traversal 3. Zip Slip
  • 83. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Vulnerability #1 Temporary Directory Hijacking
  • 84. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory on Unix-Like Systems is Shared between All Users
  • 85. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Vulnerable File f = File.createTempFile( "prefix", "suffix" ); f.delete(); f.mkdir();
  • 86. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 87. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Vulnerable File f = File.createTempFile( "prefix", "suffix" ); f.delete(); f.mkdir();
  • 88. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Vulnerable File f = File.createTempFile( "prefix", "suffix" ); f.delete(); // 🏁 Race condition f.mkdir(); // Returns `false`
  • 89. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Imperfect Fix File f = File.createTempFile( "prefix", "suffix" ); f.delete(); if(!f.mkdir()) throw new IOException("Error");
  • 90. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Fix // Since Java 1.7 File f = Files .createTempDirectory("prefix") .toFile();
  • 91. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - CVEs ● CVE-2022-27772 - Spring Boot ● CVE-2021-20202 - Keycloak ● CVE-2021-21331 - DataDog API ● CVE-2020-27216 - Eclipse Jetty ● CVE-2020-17521 - Apache Groovy ● CVE-2020-17534 - Apache netbeans-html4j
  • 92. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking Pull Request Statistics
  • 93. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking 64 Pull Requests!
  • 94. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Pull Requests
  • 95. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Putting it all together
  • 96. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Temporary Directory Hijacking - Putting it all together
  • 97. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Vulnerability #2 Partial Path Traversal
  • 98. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh "/user/sam" Partial Path Traversal
  • 99. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh "/user/sam" "/user/samantha" Partial Path Traversal
  • 100. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Allows an attacker access to a sibling directory with the same prefix Partial Path Traversal
  • 101. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Allows an attacker access to a sibling directory with the same prefix "/user/sam" Partial Path Traversal
  • 102. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Allows an attacker access to a sibling directory with the same prefix "/user/sam" "/user/samantha" Partial Path Traversal
  • 103. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Allows an attacker access to a sibling directory with the same prefix "/user/sam" "/user/samantha" Partial Path Traversal
  • 104. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( parent, userControlled() ); if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { throw new IOException( "Detected path traversal attack!" ); }
  • 105. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh new File("/user/sam/")
  • 106. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh new File("/user/sam/") File.getCanonicalPath()
  • 107. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh new File("/user/sam/") File.getCanonicalPath() "/user/sam"
  • 108. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh new File("/user/sam/") File.getCanonicalPath() "/user/sam"
  • 109. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( parent, userControlled() ); if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { throw new IOException( "Detected path traversal attack!" ); }
  • 110. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( "/user/sam/", userControlled() ); if (!dir.getCanonicalPath() .startsWith("/user/sam")) { ... }
  • 111. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( "/user/sam/", "../samantha/baz" ); if (!dir.getCanonicalPath() .startsWith("/user/sam")) { ... }
  • 112. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( "/user/sam/", "../samantha/baz" ); if (!"/user/samantha/baz" .startsWith("/user/sam")) { ... }
  • 113. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( "/user/sam/", "../samantha/baz" ); if (!"/user/samantha/baz" .startsWith("/user/sam")) { throw new IOException( "Detected path traversal attack!" ); } ❌
  • 114. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal Fix!
  • 115. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( parent, userControlled() ); if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { throw new IOException( "Detected path traversal attack!" ); }
  • 116. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { ... }
  • 117. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Fix #1 if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath() + File.separatorChar)) { ... }
  • 118. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Fix #2 if (!dir.getCanonicalFile() .toPath().startsWith( parent.getCanonicalFile().toPath())) { ... }
  • 119. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Fix #2 - Better if (!dir.getCanonicalFile() .toPath().startsWith( parent.getCanonicalFile().toPath())) { ... } ✅
  • 120. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh How do we find this vulnerability?
  • 121. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability File dir = new File( parent, userControlled() ); if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { throw new IOException( "Detected path traversal attack!" ); }
  • 122. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { ... }
  • 123. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { ... }
  • 124. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Safe if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath() + File.separatorChar)) { ... }
  • 125. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh It can’t be that easy, can it?
  • 126. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { ... }
  • 127. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability String dirCanonical = dir.getCanonicalPath(); if (!dirCanonical .startsWith(parent.getCanonicalPath())) { ... }
  • 128. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath(); if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 129. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Vulnerability String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 130. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We need Data Flow Analysis
  • 131. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - DataFlow String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 132. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Data Flow String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 133. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Data Flow String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 134. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Data Flow String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; if (!dirCanonical .startsWith(pCanonical)) { ... }
  • 135. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Data Flow String dirCanonical = dir.getCanonicalPath(); String pCanonical = parent.getCanonicalPath() + File.separatorChar; String pCanonical2 = pCanonical; if (!dirCanonical .startsWith(pCanonical2)) { ... }
  • 136. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Data Flow Uncovers hard to find Vulnerabilities and prevents False Positives
  • 137. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Data Flow Analysis class GetCanonicalPathToStartsWithLocalFlowextends LocalFlowSpec<J.MethodInvocation , Expression> { @Override public boolean isSource(J.MethodInvocation methodInvocation, Cursor cursor) { return new MethodMatcher( "java.io.File getCanonicalPath()" ) .matches( methodInvocation); } @Override public boolean isSink(Expression expression, Cursor cursor) { return InvocationMatcher . fromMethodMatcher( new MethodMatcher( "java.lang.String startsWith(java.lang.String)" ) ) .advanced() .isSelect( cursor); } }
  • 138. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Partial Path Traversal - Putting it all together
  • 139. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Example Case: AWS Java SDK CVE-2022-31159
  • 140. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 141. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 142. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Vulnerability Disclosure Drama!
  • 143. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Aside: Email with AWS Security Team AWS: We’d like to award you a bug bounty, however you’d need to sign an NDA.
  • 144. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Aside: Email with AWS Security Team AWS: We’d like to award you a bug bounty, however you’d need to sign an NDA. Jonathan: I don’t normally agree to NDA’s. Can I read it first before potentially agreeing?
  • 145. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Aside: Email with AWS Security Team AWS: We’d like to award you a bug bounty, however you’d need to sign an NDA. Jonathan: I don’t normally agree to NDA’s. Can I read it first before potentially agreeing? AWS: We’re unable to share the bug bounty program NDA since it and other contract documents are considered sensitive by the legal team.
  • 146. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 147. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 148. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 149. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Vulnerability #3 Zip Slip
  • 150. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip Path Traversal Vulnerability while Unpacking Zip File Entries
  • 151. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip void zipSlip(File destination, ZipFile zip) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.hasMoreElements()) { ZipEntry e = entries.nextElement(); File f = new File(destination, e.getName()); IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) ); } }
  • 152. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = entries.nextElement(); File f = new File(destination, e.getName()); IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 153. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip is Complicated
  • 154. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = ... File f = new File(destination, e.getName()); IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 155. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = ... File f = new File(destination, e.getName()); if (!f.toPath().startsWith(destination.toPath())) { throw new IOException("Bad Zip Entry!"); } IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 156. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh The Problem with Zip Slip
  • 157. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = ... File f = new File(destination, e.getName()); if (!f.toPath().startsWith(destination.toPath())) { throw new IOException("Bad Zip Entry!"); } IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 158. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = ... File f = new File(destination, e.getName()); if (f.toPath().startsWith(destination.toPath())) { IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) ); }
  • 159. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Control Flow Analysis
  • 160. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Control Flow Analysis File f = new File(destination, e.getName()); IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) ); File f = new File(destination, e.getName()); if (!f.toPath().startsWith(destination.toPath())){ throw new IOException("Bad Zip Entry!"); } IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 161. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Control Flow - OpenRewrite
  • 162. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip ZipEntry e = ... File f = new File(destination, e.getName()); if (!f.toPath().startsWith(destination.toPath())) { throw new IOException("Bad Zip Entry!"); } IOUtils.copy( zip.getInputStream(e), new FileOutputStream(f) );
  • 163. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip File f = new File(destination, e.getName()); if (!f.toPath().startsWith( destination.toPath())) { throw new IOException("Bad Zip Entry!" ); } IOUtils.copy( zip.getInputStream( e), new FileOutputStream( f) );
  • 164. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip - Putting it all together
  • 165. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip - Putting it all together
  • 166. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Zip Slip - Putting it all together
  • 167. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation!
  • 168. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 169. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Problems with Pull Request Generation
  • 170. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh How fast can we generate Pull Requests?
  • 171. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository
  • 172. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit
  • 173. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub
  • 174. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub
  • 175. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes
  • 176. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub
  • 177. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub
  • 178. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps File IO Git Operation GitHub API .
  • 179. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository File IO Git Operation GitHub API .
  • 180. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit File IO Git Operation GitHub API .
  • 181. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub File IO Git Operation GitHub API .
  • 182. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub File IO Git Operation GitHub API .
  • 183. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes File IO Git Operation GitHub API .
  • 184. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub File IO Git Operation GitHub API .
  • 185. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub File IO Git Operation GitHub API .
  • 186. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub File IO Git Operation GitHub API .
  • 187. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Pull Request Generation Steps 1. Checkout (ie. Download) code Repository 2. Branch, Apply Diff, & Commit 3. Fork Repository on GitHub 4. Rename Repository on GitHub 5. Push changes 6. Create Pull Request on GitHub
  • 188. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Let’s talk about... GitHub’s API Rate Limiter
  • 189. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Github Documentation “If you're making a large number of POST, PATCH, PUT, or DELETE requests for a single user or client ID, wait at least one second between each request.”
  • 190. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Github Documentation “When you have been limited, use the Retry-After response header to slow down. The value of the Retry-After header will always be an integer, representing the number of seconds you should wait before making requests again.”
  • 191. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Something New Appeared in 2022
  • 192. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Github Documentation “Requests that create content which triggers notifications, such as issues, comments and pull requests, may be further limited and will not include a Retry-After header in the response. Please create this content at a reasonable pace to avoid further limiting.”
  • 193. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Github Documentation “Requests that create content which triggers notifications, such as issues, comments and pull requests, may be further limited and will not include a Retry-After header in the response. Please create this content at a reasonable pace to avoid further limiting.”
  • 194. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Github Documentation “Requests that create content which triggers notifications, such as issues, comments and pull requests, may be further limited and will not include a Retry-After header in the response. Please create this content at a reasonable pace to avoid further limiting.”
  • 195. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 196. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We’ve made it this far ✅ Vulnerabilities Detected ✅ Style Detected ✅ Code Fixed & Diff Generated ✅ Rate Limit Bypassed
  • 197. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We’ve made it this far ✅ Vulnerabilities Detected ✅ Style Detected ✅ Code Fixed & Diff Generated ✅ Rate Limit Bypassed How do we do this for all the repositories?
  • 198. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Moderne ● Free for Open Source Projects! ● ~7,000 Repositories indexed ● Run Open Rewrite Transformations at Scale ● Generates and Updates Pull Requests
  • 199. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh 800+ OpenRewrite Recipes including complete Framework Migrations
  • 200. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh It’s not just your code that needs to be secure It’s also the dependencies
  • 201. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh 800+ OpenRewrite Recipes including complete Framework Migrations
  • 202. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Bulk Pull Request Generation - public.moderne.io
  • 203. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 204. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 205. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh But there are more than just 7,000 repositories in the world How do we find the other vulnerable projects?
  • 206. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL
  • 207. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL 100k+ OSS Projects Indexed 35k+ OSS Java Projects
  • 208. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh https://github.com/moderneinc/jenkins-ingest
  • 209. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal if (!dir.getCanonicalPath() .startsWith(parent.getCanonicalPath())) { ... }
  • 210. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh With the list of vulnerable projects in hand!
  • 211. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Finally! Let’s generate some Open Source Software Pull Requests!
  • 212. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 213. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Bulk Pull Request Generation Statistics Project PR Generator Pull Requests Merge Rate HTTP Download of Dependencies Python Bot 1,596 40% CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3% CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6% Temporary Directory Hijacking Moderne 64 25% Partial Path Traversal Moderne 50 22% Zip Slip Moderne 152 20%
  • 214. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Bulk Pull Request Generation Statistics Project PR Generator Pull Requests Merge Rate HTTP Download of Dependencies Python Bot 1,596 40% CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3% CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6% Temporary Directory Hijacking Moderne 64 25% Partial Path Traversal Moderne 50 22% Zip Slip Moderne 152 20% New Pull Requests Generated in 2022: 600+
  • 215. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Bulk Pull Request Generation Statistics Project PR Generator Pull Requests Merge Rate HTTP Download of Dependencies Python Bot 1,596 40% CVE-2019-16303: JHipster RNG Vulnerability Python Bot + Moderne 3,467 2.3% CVE-2020-8597: rhostname array overflow Python Bot 1,885 7.6% Temporary Directory Hijacking Moderne 64 25% Partial Path Traversal Moderne 50 22% Zip Slip Moderne 152 20% Personally Generated: 5,200+ Pull Requests
  • 216. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 217. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 218. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Best Practices for Bulk Pull Request Generation
  • 219. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Messaging!
  • 220. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh All Software Problems are People Problems In Disguise
  • 221. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 1 Sign off all Commits --signoff
  • 222. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Sign off on Commits Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
  • 223. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Sign off on Commits Why?!
  • 224. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Sign off on Commits “It was introduced in the wake of the SCO lawsuit, (and other accusations of copyright infringement from SCO, most of which they never actually took to court), as a Developers Certificate of Origin. It is used to say that you certify that you have created the patch in question, or that you certify that to the best of your knowledge, it was created under an appropriate open-source license, or that it has been provided to you by someone else under those terms.” - Stack Overflow
  • 225. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh TL;DR
  • 226. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lawyers
  • 227. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 228. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 2 Be a good commitizen
  • 229. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 2 Be a good commitizen GPG Sign your Commits
  • 230. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 231. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 232. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 3 SECOM Commit Format
  • 233. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh SECOM
  • 234. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 4 There are risks using your personal GitHub Account
  • 235. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Anyone here familiar with GitHub’s Angry Unicorn?
  • 236. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh This was my GitHub Profile Page for most of 2020
  • 237. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Remember GitHub’s Rate Limit?
  • 238. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 239. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 5 Coordinate with GitHub
  • 240. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Before Attempting Reach out to GitHub! SecurityLab@github.com
  • 241. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Lesson 6 Consider the Implications
  • 242. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 243. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Conclusion
  • 244. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh As Security Researchers
  • 245. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We have an obligation to society
  • 246. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh We know these vulnerabilities are out there
  • 247. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh “For every 500 developers you have one security researcher.” - GitHub 2020
  • 248. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 249. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh - Dan Kaminsky (1979 – 2021) “We can fix it. We have the technology. OK. We need to create the technology. Alright. The policy guys are mucking with the technology. Relax. WE'RE ON IT.
  • 250. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh ● Learn CodeQL! Seriously! It’s an incredibly powerful language! ● Contribute to OpenRewrite! Deploy your security fixes at scale! ● Join the GitHub Security Lab & OpenRewrite Slack Channels! ● Join the Open Source Security Foundation (OSSF)!
  • 251. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh Thanks Lidia Giuliano Shyam Mehta
  • 252. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh @JLLeitschuh Jonathan.Leitschuh@gmail.com
  • 253. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh
  • 254. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 255. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 256. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 257. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 258. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 259. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 260. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 261. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 262. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 263. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal
  • 264. Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once and For All - Jonathan Leitschuh @JLLeitschuh CodeQL: Partial Path Traversal