Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
ed3b24dc
Commit
ed3b24dc
authored
10 years ago
by
Jaime Pérez
Browse files
Options
Downloads
Plain Diff
Merge pull request #144 from thijskh/disable_xxe
Disable the loading of external entities in XML documents.
parents
d40ac9a0
e60d4802
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/SimpleSAML/Utilities.php
+11
-0
11 additions, 0 deletions
lib/SimpleSAML/Utilities.php
www/_include.php
+2
-2
2 additions, 2 deletions
www/_include.php
with
13 additions
and
2 deletions
lib/SimpleSAML/Utilities.php
+
11
−
0
View file @
ed3b24dc
...
...
@@ -1930,6 +1930,17 @@ class SimpleSAML_Utilities {
date_default_timezone_set
(
$serverTimezone
);
}
/**
* Disable the loading of external entities in XML documents to prevent local and
* remote file inclusion attacks. This is in most cases already disabled by default
* in system libraries, but to be safe we explicitly disable it also.
*/
public
static
function
disableXMLEntityLoader
()
{
/* Function only present in PHP >= 5.2.11 while we support 5.2+ */
if
(
function_exists
(
'libxml_disable_entity_loader'
)
)
{
libxml_disable_entity_loader
();
}
}
/**
* Atomically write a file.
...
...
This diff is collapsed.
Click to expand it.
www/_include.php
+
2
−
2
View file @
ed3b24dc
...
...
@@ -107,5 +107,5 @@ if (!file_exists($configdir . '/config.php')) {
/* Set the timezone. */
SimpleSAML_Utilities
::
initTimezone
();
?>
\ No newline at end of file
/* Disable XML external entity loading explicitly. */
SimpleSAML_Utilities
::
disableXMLEntityLoader
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment