Skip to content

Commit b5e8427

Browse files
author
threedr3am
committed
add Query
1 parent e3b6694 commit b5e8427

File tree

1 file changed

+4
-1
lines changed
  • spring/spring-data-mongodb-spel-CVE-2022-22980/src/main/java/com/threedr3am/bug/spring/data/mongodb/repository

1 file changed

+4
-1
lines changed

spring/spring-data-mongodb-spel-CVE-2022-22980/src/main/java/com/threedr3am/bug/spring/data/mongodb/repository/DemoRepository.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
@org.springframework.stereotype.Repository
99
public interface DemoRepository extends Repository<Demo, String> {
1010

11-
@Query("{ arg0 : :#{?0} }")
11+
@Query("{ id : :#{?0} }")
1212
List<Demo> findAllByIdLike(String keyword);
13+
14+
@Query("{ id : ?#{?0} }")
15+
List<Demo> findAllByIdLike2(String keyword);
1316
}

0 commit comments

Comments
 (0)