Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
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
Openfire
Commits
10caae62
Unverified
Commit
10caae62
authored
Nov 02, 2017
by
Dave Cridland
Committed by
GitHub
Nov 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #869 from surevine/plugin-xee
Disable External Entities in plugin.xml
parents
9b5f7f47
7ef3f0d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
PluginMetadataHelper.java
...jivesoftware/openfire/container/PluginMetadataHelper.java
+10
-0
No files found.
src/java/org/jivesoftware/openfire/container/PluginMetadataHelper.java
View file @
10caae62
...
...
@@ -24,7 +24,11 @@ import org.jivesoftware.openfire.XMPPServer;
import
org.jivesoftware.util.Version
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.xml.sax.EntityResolver
;
import
org.xml.sax.InputSource
;
import
org.xml.sax.SAXException
;
import
java.io.IOException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.nio.file.Files
;
...
...
@@ -503,6 +507,12 @@ public class PluginMetadataHelper
if
(
Files
.
exists
(
pluginConfig
)
)
{
final
SAXReader
saxReader
=
new
SAXReader
();
saxReader
.
setEntityResolver
(
new
EntityResolver
()
{
@Override
public
InputSource
resolveEntity
(
String
publicId
,
String
systemId
)
throws
SAXException
,
IOException
{
throw
new
IOException
(
"External entity denied: "
+
publicId
+
" // "
+
systemId
);
}
});
saxReader
.
setEncoding
(
"UTF-8"
);
final
Document
pluginXML
=
saxReader
.
read
(
pluginConfig
.
toFile
()
);
final
Element
element
=
(
Element
)
pluginXML
.
selectSingleNode
(
xpath
);
...
...
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