Skip to content

Commit c9fbe2b

Browse files
committed
Switch to OpenFeign QueryDSL
because of CVE-2024-49203. Closes #2409. Signed-off-by: mikereiche <[email protected]>
1 parent 1c541ac commit c9fbe2b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

pom.xml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<jodatime>2.10.13</jodatime>
2727
<jackson-joda>2.13.4</jackson-joda>
2828
<jakarta.el>4.0.0</jakarta.el>
29+
<querydsl_of>6.11</querydsl_of>
2930
</properties>
3031

3132
<dependencyManagement>
@@ -43,10 +44,12 @@
4344
<dependencies>
4445

4546
<dependency>
47+
<!--
4648
<groupId>com.querydsl</groupId>
49+
-->
50+
<groupId>io.github.openfeign.querydsl</groupId>
4751
<artifactId>querydsl-apt</artifactId>
48-
<version>${querydsl}</version>
49-
<classifier>jakarta</classifier>
52+
<version>${querydsl_of}</version>
5053
<scope>provided</scope>
5154
</dependency>
5255

src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
2121
import static org.junit.jupiter.api.Assertions.assertEquals;
2222
import static org.junit.jupiter.api.Assertions.assertNull;
23+
import static org.junit.jupiter.api.Assertions.assertThrows;
2324
import static org.springframework.data.couchbase.util.Util.comprises;
2425
import static org.springframework.data.couchbase.util.Util.exactly;
2526

@@ -29,6 +30,7 @@
2930
import java.util.Optional;
3031
import java.util.stream.StreamSupport;
3132

33+
import com.querydsl.core.types.dsl.PathBuilder;
3234
import org.junit.jupiter.api.AfterAll;
3335
import org.junit.jupiter.api.BeforeAll;
3436
import org.junit.jupiter.api.BeforeEach;
@@ -43,8 +45,10 @@
4345
import org.springframework.data.couchbase.core.mapping.event.ValidatingCouchbaseEventListener;
4446
import org.springframework.data.couchbase.core.query.QueryCriteriaDefinition;
4547
import org.springframework.data.couchbase.domain.Airline;
48+
import org.springframework.data.couchbase.domain.AirlineCollectioned;
4649
import org.springframework.data.couchbase.domain.AirlineRepository;
4750
import org.springframework.data.couchbase.domain.QAirline;
51+
import org.springframework.data.couchbase.domain.QAirlineCollectioned;
4852
import org.springframework.data.couchbase.repository.auditing.EnableCouchbaseAuditing;
4953
import org.springframework.data.couchbase.repository.auditing.EnableReactiveCouchbaseAuditing;
5054
import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories;
@@ -147,6 +151,13 @@ void testEq() {
147151
}
148152
}
149153

154+
@Test
155+
void testInjection() {
156+
String userSpecifiedPath = "1 = 1) OR (2";
157+
PathBuilder<QAirline> pathBuilder = new PathBuilder<>(QAirline.class, "xyz");
158+
assertThrows(IllegalStateException.class, () -> pathBuilder.get(userSpecifiedPath).eq("2"));
159+
}
160+
150161
// this gives hqCountry == "" and hqCountry is missing
151162
// @Test
152163
void testStringIsEmpty() {

0 commit comments

Comments
 (0)