Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
c5d331ad
Commit
c5d331ad
authored
Mar 28, 2024
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL Injection: MyBatis Mapper(SQL注入:MyBatis Mapper)
parent
25ebaacd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
PluginInterceptor.java
...boot/module/common/api/interceptor/PluginInterceptor.java
+2
-1
PluginInterceptor.java
...oin/equipmanage/common/interceptor/PluginInterceptor.java
+2
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/interceptor/PluginInterceptor.java
View file @
c5d331ad
...
@@ -11,6 +11,7 @@ import org.apache.ibatis.plugin.*;
...
@@ -11,6 +11,7 @@ import org.apache.ibatis.plugin.*;
import
org.apache.ibatis.session.ResultHandler
;
import
org.apache.ibatis.session.ResultHandler
;
import
org.apache.ibatis.session.RowBounds
;
import
org.apache.ibatis.session.RowBounds
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ReflectionUtils
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -80,7 +81,7 @@ public class PluginInterceptor implements Interceptor {
...
@@ -80,7 +81,7 @@ public class PluginInterceptor implements Interceptor {
//通过反射修改sql语句
//通过反射修改sql语句
Field
field
=
boundSql
.
getClass
().
getDeclaredField
(
"sql"
);
Field
field
=
boundSql
.
getClass
().
getDeclaredField
(
"sql"
);
field
.
setAccessible
(
true
);
ReflectionUtils
.
makeAccessible
(
field
);
field
.
set
(
boundSql
,
sql
);
field
.
set
(
boundSql
,
sql
);
return
executor
.
query
(
mappedStatement
,
parameter
,
rowBounds
,
resultHandler
,
cacheKey
,
boundSql
);
return
executor
.
query
(
mappedStatement
,
parameter
,
rowBounds
,
resultHandler
,
cacheKey
,
boundSql
);
}
else
{
}
else
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/interceptor/PluginInterceptor.java
View file @
c5d331ad
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.plugin.*;
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.plugin.*;
import
org.apache.ibatis.session.ResultHandler
;
import
org.apache.ibatis.session.ResultHandler
;
import
org.apache.ibatis.session.RowBounds
;
import
org.apache.ibatis.session.RowBounds
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ReflectionUtils
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -78,7 +79,7 @@ public class PluginInterceptor implements Interceptor {
...
@@ -78,7 +79,7 @@ public class PluginInterceptor implements Interceptor {
//通过反射修改sql语句
//通过反射修改sql语句
Field
field
=
boundSql
.
getClass
().
getDeclaredField
(
"sql"
);
Field
field
=
boundSql
.
getClass
().
getDeclaredField
(
"sql"
);
field
.
setAccessible
(
true
);
ReflectionUtils
.
makeAccessible
(
field
);
field
.
set
(
boundSql
,
sql
);
field
.
set
(
boundSql
,
sql
);
return
executor
.
query
(
mappedStatement
,
parameter
,
rowBounds
,
resultHandler
,
cacheKey
,
boundSql
);
return
executor
.
query
(
mappedStatement
,
parameter
,
rowBounds
,
resultHandler
,
cacheKey
,
boundSql
);
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment