Skip to content
Snippets Groups Projects
  1. Oct 16, 2017
  2. Oct 10, 2017
    • Jaime Pérez Crespo's avatar
    • Jaime Pérez Crespo's avatar
      bugfix: Make sure no JS code can be injected into redirected URLs · 5f074e97
      Jaime Pérez Crespo authored
      In order to fix this, we first sanitize any URL given to SimpleSAML\Utils\HTTP::checkURLAllowed() so that we make sure we have a true URL without spurious characters. Secondly, we stop using an "onload" event in the body of the redirect page to trigger the redirect automatically. Instead, we use a "meta refresh" redirection.
      
      This double remediation is because there were two issues here: one, we were printing user input inside a chunk of javascript code. The other exploits the fact that the header() function silently breaks when a null character is part of the URL given to a "Location" header. In that case, the HTTP 302 Redirection doesn't happen, and then the browser loads the HTML and goes through it, running the injected javascript.
      
      This fixes #699.
      5f074e97
  3. Oct 04, 2017
  4. Sep 22, 2017
  5. Sep 07, 2017
  6. Sep 05, 2017
    • Thijs Kinkhorst's avatar
      Bugfix: searchformultiple() would stop on first dn even when nothing found. · 71bacd03
      Thijs Kinkhorst authored
      searchformultiple() will loop over all the configured base dn's to
      search in. However, it would break on the first search that does
      not return `false`. A search that yields 0 hits is not `false`, however
      (it is only false when an error occurred). So when using more than one
      base, users would not be found if they were part of the second or later
      base, which is contrary to the intention.
      
      This is now changed so the loop breaks when the result is not false, and
      the number of found results is > 0.
      71bacd03
  7. Sep 01, 2017
  8. Aug 15, 2017
    • manu0401's avatar
      Update PHP API change gor ldapwhoami (#674) · f26d8640
      manu0401 authored
      I have been maintaining the PHP LDAP EXOP patch for a few years,
      which include the ldapwhoami() function. This has finally made its
      way into PHP distribution and will be available in PHP 7.3, but
      with a modified prototype.
      
      This changes adapts to this API change. While there, also update
      exception handling on par with recent SimpleSAMLphp code.
      f26d8640
  9. Aug 04, 2017
  10. Aug 03, 2017
  11. Aug 01, 2017
  12. Jul 20, 2017
    • Scato Eggen's avatar
      Invalidate opcache after writing a file · cd8179d7
      Scato Eggen authored
      When opcache.validate_timestamps is disabled, then the new metadata will not be read after a metarefresh.
      This can be solved by adding the metadata file to an opcache blacklist, but calling opcache_invalidate()
      after writing a file is a nice out-of-the-box solution.
      
      Hopefully, this will enable everybody that is using simplesamlphp to disable opcache.validate_timestamps
      without running into problems.
      cd8179d7
  13. Jul 18, 2017
  14. Jul 07, 2017
    • Patrick Radtke's avatar
      Use a base test class instead of a listener · d3512561
      Patrick Radtke authored
      To convert existing tests to use the base class use
      
       perl -p -i -e 's/PHPUnit_Framework_TestCase/SimpleSAML\\Test\\Utils\\ClearStateTestCase/g' `grep -rl PHPUnit_Framework_TestCase tests | grep -v ClearStateTestCase.php`
      d3512561
  15. Jul 05, 2017
  16. Jul 04, 2017
    • Jaime Pérez Crespo's avatar
      Further optimize the SimpleSAML\Module class. · 7b3a5c0d
      Jaime Pérez Crespo authored
      Instead of one cache, we need to use two: one for the list of modules available, and the other for the details for them. Those caches should be filled independently, so that someone calling getModules() does not trigger the code checking of the modules are enabled or finding their hooks.
      7b3a5c0d
    • Jaime Pérez Crespo's avatar
      Do not automatically load all the template directories of all modules. · 7ec9caa0
      Jaime Pérez Crespo authored
      It has also an impact in performance, and covers an unlikely scenario. Instead, if you plan to use templates from another module, now you need to call the "addTemplatesFromModule()" method right after creating the template. That way you can register manually what templates you are supposed to use, being much more efficient.
      7ec9caa0
    • Jaime Pérez Crespo's avatar
      Remove the 'templateInit' hook. · a506502b
      Jaime Pérez Crespo authored
      An alternative way to inject data in the templates should be used. This has a terrible impact in performance, and could have undesired side effects.
      a506502b
    • Jaime Pérez Crespo's avatar
      Add a method to get the twig object used in a template. · d0e09690
      Jaime Pérez Crespo authored
      This allows template users to use their own twig extensions if they want, while also allowing us to remove the "twigInit" hook. Hooks come at a price, and it doesn't make much sense to use them in this case, as they would only be useful if a module wants to add a twig extension even if the code instantiating SimpleSAML_XHTML_Template does not belong to that module. This could lead to unexpected behaviour (i.e. a module adding a hook that creates trouble for the templates defined in another module), so given the lack of use cases supporting the hook and the possible negative consequences implied, it's better to remove it.
      d0e09690
  17. Jun 30, 2017
    • Jaime Pérez Crespo's avatar
      Enhance the performance of SimpleSAML\Module. · 4e68df80
      Jaime Pérez Crespo authored
      The issue here is that every time we need to list the modules or check if they are enabled, we just iterate over the modules directory and subdirectories, which is terribly expensive. Instead of doing so, we build a cache of modules specifying if they are enabled or not. In the end, this is also fixing another issue, given that enabling/disabling a module in the middle of a request being processed could lead to inconsistencies and unexpected behaviour (likely exceptions and horrible crashes). Modules should be checked in the beginning of a request and their state (enabled/disabled) frozen until the request is processed to avoid that, and this is the way to achieve so.
      
      Additionally, we take the chance to check if modules are enabled when we search for them. This reduces the processing time to around a third of the original without this fix.
      4e68df80
  18. Jun 28, 2017
Loading