Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2022-41828 — [CVE-2022-41828] Amazon AWS Redshift JDBC Driver 원격 코드 실행 (RCE) | Kitploit
도구/GitHubGitHub/murataydemir/cve-2022-41828
Vulnerability AnalysisExploitationWeb Application ExploitationCloud SecurityLearning & EducationDatabase Security
GitHubmurataydemir/cve-2022-41828

CVE-2022-41828

[CVE-2022-41828] Amazon AWS Redshift JDBC Driver 원격 코드 실행 (RCE)

저장소 보기
42173년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

[CVE-2022-41828] Amazon AWS Redshift JDBC 드라이버 원격 코드 실행 (RCE)


Platform Badge Ecosystem

Amazon JDBC Driver for Redshift는 Java Platform, Enterprise Editions에서 제공하는 표준 JDBC 애플리케이션 프로그래밍 인터페이스(API)를 통해 데이터베이스 연결을 제공하는 Type 4 JDBC 드라이버입니다. 이 드라이버는 모든 Java 애플리케이션, 애플리케이션 서버 또는 Java 지원 애플릿에서 Redshift에 접근할 수 있도록 합니다.

redshift-jdbc42 버전 2.1.0.7 이하에서 잠재적인 원격 명령 실행 문제가 존재합니다. 드라이버와 함께 플러그인을 사용할 때, sslhostnameverifier, socketFactory, sslfactory, sslpasswordcallback 연결 속성을 통해 제공된 Java 클래스 이름을 기반으로 플러그인 인스턴스를 인스턴스화합니다. 영향을 받는 버전에서 드라이버는 인스턴스화 전에 플러그인 클래스가 예상된 인터페이스를 구현하는지 확인하지 않습니다. 이로 인해 임의의 Java 클래스가 로드될 수 있으며, JDBC URL을 제어할 수 있는 지식이 있는 공격자가 이를 사용하여 원격 코드 실행을 달성할 수 있습니다.

패치

이 문제는 redshift-jdbc-42 버전 2.1.0.8 이상에서 패치되었습니다.

해결 방법

AWS는 플러그인을 사용하는 고객에게 redshift-jdbc42 버전 2.1.0.8 이상으로 업그레이드할 것을 권장합니다. 이 문제에 대해 알려진 해결 방법은 없습니다.

패치 분석: GitHub 이슈 및 관련 커밋

이 문제를 해결하기 위해 커밋 aws/amazon-redshift-jdbc-driver@9999659에서 4개의 Java 클래스가 수정되었습니다. 각각의 클래스는 다음과 같습니다.

  • src/main/java/com/amazon/redshift/core/SocketFactoryFactory.java
@@ -38,7 +38,7 @@ public static SocketFactory getSocketFactory(Properties info) throws RedshiftExc
      return SocketFactory.getDefault();
    }
    try {
      //removed return (SocketFactory) ObjectFactory.instantiate(socketFactoryClassName, info, true, RedshiftProperty.SOCKET_FACTORY_ARG.get(info));
      return ObjectFactory.instantiate(SocketFactory.class, socketFactoryClassName, info, true, RedshiftProperty.SOCKET_FACTORY_ARG.get(info)); //added
    } catch (Exception e) {
      throw new RedshiftException(
@@ -66,7 +66,7 @@ public static SSLSocketFactory getSslSocketFactory(Properties info) throws Redsh
      if (classname.equals(RedshiftConnectionImpl.NON_VALIDATING_SSL_FACTORY))
      		classname = NonValidatingFactory.class.getName();

      //removed return (SSLSocketFactory) ObjectFactory.instantiate(classname, info, true, RedshiftProperty.SSL_FACTORY_ARG.get(info));
      return  ObjectFactory.instantiate(SSLSocketFactory.class, classname, info, true, RedshiftProperty.SSL_FACTORY_ARG.get(info)); //added
    } catch (Exception e) {
      throw new RedshiftException(

commit-1

  • src/main/java/com/amazon/redshift/ssl/LibPQFactory.java
@@ -61,7 +61,7 @@ private CallbackHandler getCallbackHandler(Properties info) throws RedshiftExcep
    String sslpasswordcallback = RedshiftProperty.SSL_PASSWORD_CALLBACK.get(info);
    if (sslpasswordcallback != null) {
      try {
        //removed cbh = (CallbackHandler) ObjectFactory.instantiate(sslpasswordcallback, info, false, null);
        cbh =  ObjectFactory.instantiate(CallbackHandler.class, sslpasswordcallback, info, false, null); //added
      } catch (Exception e) {
        throw new RedshiftException(
          GT.tr("The password callback class provided {0} could not be instantiated.",

commit-2

  • src/main/java/com/amazon/redshift/ssl/MakeSSL.java
@@ -59,7 +59,7 @@ private static void verifyPeerName(RedshiftStream stream, Properties info, SSLSo
      sslhostnameverifier = "RedshiftjdbcHostnameVerifier";
    } else {
      try {
        //removed hvn = (HostnameVerifier) instantiate(sslhostnameverifier, info, false, null);
        hvn = instantiate(HostnameVerifier.class, sslhostnameverifier, info, false, null); //added
      } catch (Exception e) {
        throw new RedshiftException(
            GT.tr("The HostnameVerifier class provided {0} could not be instantiated.",

commit-3

  • src/main/java/com/amazon/redshift/util/ObjectFactory.java
@@ -34,13 +34,13 @@ public class ObjectFactory {
   * @throws IllegalAccessException if something goes wrong
   * @throws InvocationTargetException if something goes wrong
   */
  //removed public static Object instantiate(String classname, Properties info, boolean tryString,
  public static <T> T instantiate(Class<T> expectedClass, String classname, Properties info, boolean tryString, //added
      String stringarg) throws ClassNotFoundException, SecurityException, NoSuchMethodException,
          IllegalArgumentException, InstantiationException, IllegalAccessException,
          InvocationTargetException {
    Object[] args = {info};
    Constructor<?> ctor = null; //removed
    Class<?> cls = Class.forName(classname); //removed
    Constructor<? extends T> ctor = null; //added
    Class<? extends T> cls = Class.forName(classname).asSubclass(expectedClass); //added    
    try {
      ctor = cls.getConstructor(Properties.class);
    } catch (NoSuchMethodException nsme) {

commit-4

재현: 취약한 애플리케이션 개발 및 악용 단계

CVE-2022-41828을 재현하기 위해, 취약한 redshift-jdbc42 버전 2.1.0.7 드라이버를 외부 라이브러리로 사용하는 Spring 프레임워크 기반의 취약한 Java 애플리케이션이 개발되었습니다.

다음 코드 조각은 pom.xml 파일의 내용을 나타냅니다.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>RedshiftJdbcRce</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>RedshiftJdbcRce</name>
    <description>RedshiftJdbcRce</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.amazon.redshift/redshift-jdbc42 -->
        <dependency>
            <groupId>com.amazon.redshift</groupId>
            <artifactId>redshift-jdbc42</artifactId>
            <version>2.1.0.7</version>
        </dependency>
도구 다운로드