Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
a0f4edb8
Commit
a0f4edb8
authored
Aug 13, 2017
by
D
Committed by
GitHub
Aug 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12331 from nanolikeyou/master
修复几项安全问题
parents
dbf70a36
294ebb3c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
8 deletions
+23
-8
pom.xml
pom.xml
+1
-1
src/main/java/org/b3log/solo/processor/FeedProcessor.java
src/main/java/org/b3log/solo/processor/FeedProcessor.java
+1
-2
src/main/java/org/b3log/solo/processor/LoginProcessor.java
src/main/java/org/b3log/solo/processor/LoginProcessor.java
+16
-1
src/main/webapp/js/lib/jquery/jquery.min.js
src/main/webapp/js/lib/jquery/jquery.min.js
+5
-4
No files found.
pom.xml
View file @
a0f4edb8
...
...
@@ -82,7 +82,7 @@
<jsoup.version>
1.9.1
</jsoup.version>
<flexmark.version>
0.22.16
</flexmark.version>
<qiniu.version>
7.0.4.1
</qiniu.version>
<jetty.version>
9.2.
7.v20150116
</jetty.version>
<jetty.version>
9.2.
9.v20150224
</jetty.version>
<commons-cli.version>
1.3.1
</commons-cli.version>
<emoji-java.version>
3.2.0
</emoji-java.version>
<jodd.version>
3.6.6
</jodd.version>
...
...
src/main/java/org/b3log/solo/processor/FeedProcessor.java
View file @
a0f4edb8
...
...
@@ -417,11 +417,10 @@ public class FeedProcessor {
final
String
link
=
Latkes
.
getServePath
()
+
article
.
getString
(
Article
.
ARTICLE_PERMALINK
);
ret
.
setLink
(
link
);
ret
.
setGUID
(
link
);
final
String
authorEmail
=
article
.
getString
(
Article
.
ARTICLE_AUTHOR_EMAIL
);
if
(
hasMultipleUsers
)
{
authorName
=
StringEscapeUtils
.
escapeXml
(
articleQueryService
.
getAuthor
(
article
).
getString
(
User
.
USER_NAME
));
}
ret
.
setAuthor
(
author
Email
+
"("
+
authorName
+
")"
);
ret
.
setAuthor
(
author
Name
);
final
String
tagsString
=
article
.
getString
(
Article
.
ARTICLE_TAGS_REF
);
final
String
[]
tagStrings
=
tagsString
.
split
(
","
);
for
(
final
String
tagString
:
tagStrings
)
{
...
...
src/main/java/org/b3log/solo/processor/LoginProcessor.java
View file @
a0f4edb8
...
...
@@ -146,6 +146,8 @@ public class LoginProcessor {
String
destinationURL
=
request
.
getParameter
(
Common
.
GOTO
);
if
(
Strings
.
isEmptyOrNull
(
destinationURL
))
{
destinationURL
=
Latkes
.
getServePath
()
+
Common
.
ADMIN_INDEX_URI
;
}
else
if
(!
isInternalLinks
(
destinationURL
))
{
destinationURL
=
"/"
;
}
final
HttpServletResponse
response
=
context
.
getResponse
();
...
...
@@ -244,7 +246,7 @@ public class LoginProcessor {
String
destinationURL
=
httpServletRequest
.
getParameter
(
Common
.
GOTO
);
if
(
Strings
.
isEmptyOrNull
(
destinationURL
))
{
if
(
Strings
.
isEmptyOrNull
(
destinationURL
)
||
!
isInternalLinks
(
destinationURL
)
)
{
destinationURL
=
"/"
;
}
...
...
@@ -265,6 +267,8 @@ public class LoginProcessor {
if
(
Strings
.
isEmptyOrNull
(
destinationURL
))
{
destinationURL
=
Latkes
.
getServePath
()
+
Common
.
ADMIN_INDEX_URI
;
}
else
if
(!
isInternalLinks
(
destinationURL
))
{
destinationURL
=
"/"
;
}
renderPage
(
context
,
"reset-pwd.ftl"
,
destinationURL
,
request
);
...
...
@@ -484,4 +488,15 @@ public class LoginProcessor {
Keys
.
fillRuntime
(
dataModel
);
filler
.
fillMinified
(
dataModel
);
}
/**
* Preventing unvalidated redirects and forwardsSee more at:
* <a>https://www.owasp.org/index.php/
* Unvalidated_Redirects_and_Forwards_Cheat_Sheet</a>
*
* @return whether the destinationURL is an internal link
*/
private
boolean
isInternalLinks
(
String
destinationURL
)
{
return
destinationURL
.
startsWith
(
Latkes
.
getServePath
());
}
}
src/main/webapp/js/lib/jquery/jquery.min.js
View file @
a0f4edb8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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