Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
6b8907c
add CVE note to installation notes for simplesamlphp config
jazzsequence May 6, 2025
f74d5ec
bump composer dependencies
jazzsequence May 6, 2025
57ff884
update changelog
jazzsequence May 6, 2025
8e68274
Update SimpleSAMLphp security requirements to 2.3.7.
lcatlett May 6, 2025
43733ea
Merge branch 'develop' into cve-2025-27773
jazzsequence May 9, 2025
62ff8a0
Merge branch '400-cve-2025-27773' into cve-2025-27773
jazzsequence May 9, 2025
b57b645
check the class for simple saml version before other methods
jazzsequence May 9, 2025
8c7a98f
remove old wp test installer
jazzsequence May 9, 2025
7107ce7
use wpunit helpers
jazzsequence May 9, 2025
b38564e
ignore phpunit dotfiles
jazzsequence May 9, 2025
21193fd
fix link to 2.0+ simplesaml version file
jazzsequence May 9, 2025
371d6ee
allow ci to bypass user input
jazzsequence May 9, 2025
b74bdf5
update unit tests and run simplesaml tests
jazzsequence May 9, 2025
0a74f50
update behat tests to use 2.4.0
jazzsequence May 9, 2025
4e8e8ac
ignore locally installed simplesaml
jazzsequence May 9, 2025
465f9d5
linting fixes
jazzsequence May 9, 2025
a75d008
test on 8.3
jazzsequence May 9, 2025
de3c922
run chmod +x for helpers
jazzsequence May 9, 2025
db6ab10
remove php 8.3 tests
jazzsequence May 9, 2025
585c0e5
fix readme.md
jazzsequence May 9, 2025
fc7dc23
install wp-cli
jazzsequence May 9, 2025
b44f4d1
remove chmod
jazzsequence May 12, 2025
80e1e9e
bump tested-up-to version to match fixture
jazzsequence May 12, 2025
77cce91
try modifying the (new in 2.x) twig file
jazzsequence May 12, 2025
96a5b4c
cleanup composer cache for behat tests
jazzsequence May 12, 2025
bcca5ef
add new behat bootstrap
jazzsequence May 12, 2025
375f004
maybe fix gherkin i18n error in behat.yml
jazzsequence May 12, 2025
8f72676
change the path to the gherkin extension
jazzsequence May 12, 2025
fe24b52
remove the gherkin config
jazzsequence May 12, 2025
4c92a77
turn xdebug off
jazzsequence May 12, 2025
1c69211
use cachedarraykeywords hack
jazzsequence May 12, 2025
f59ca92
patch cachedarraykeywords
jazzsequence May 12, 2025
3e98ae0
put the gherkin config at the root
jazzsequence May 12, 2025
977d235
remove hack and restore test params
jazzsequence May 12, 2025
7d20221
require specific versions of behat and gherkin
jazzsequence May 12, 2025
31f6ff4
add ids to the saml login form
jazzsequence May 12, 2025
df208da
composer install saml dependencies
jazzsequence May 13, 2025
f5399ae
copy simplesamlphp into /simplesaml public dir
jazzsequence May 13, 2025
68ec4e5
remove cd
jazzsequence May 13, 2025
492da75
make the directory before copying stuff into it
jazzsequence May 13, 2025
550b7e3
only cleanup if the tests passed
jazzsequence May 13, 2025
85dcbb2
combine tests and cleanup
jazzsequence May 13, 2025
4cff697
output a url to the pantheon multidev
jazzsequence May 13, 2025
7df1875
update the cleanup to delete the 5 oldest ci- environments
jazzsequence May 13, 2025
a39e7cf
use ! {command} syntax
jazzsequence May 13, 2025
0792e4d
rewrite the dirname in the include
jazzsequence May 13, 2025
d62cf45
fix failing bash
jazzsequence May 13, 2025
b919fc4
fix the url
jazzsequence May 13, 2025
26d7c41
generate a valid config.php
jazzsequence May 13, 2025
ec3e55b
copy the templates directory over, too
jazzsequence May 13, 2025
3560947
fix the fixture idp file
jazzsequence May 13, 2025
a8aa12f
replace .additions files with actual configuration files we copy
jazzsequence May 14, 2025
2889481
refactor prepare script to use copied configuration files
jazzsequence May 14, 2025
7c267cc
restore dynamic idp connection type
jazzsequence May 14, 2025
6c9d4c9
run the temp dir setup after wp is installed
jazzsequence May 14, 2025
f3d1c44
copy the certs directory
jazzsequence May 14, 2025
590e38a
remove redundant tempdir config
jazzsequence May 14, 2025
3506425
break out the login url in logging
jazzsequence May 14, 2025
3c7ed1c
change DYNAMIC:1 to DEFAULT for idp metadata
jazzsequence May 14, 2025
74ad343
use a full url for the baseurlpath to simplesaml
jazzsequence May 14, 2025
3456629
update scripts to copy the full php files
jazzsequence May 14, 2025
de89c45
we need to copy the metadata over
jazzsequence May 14, 2025
0340ee1
explicit config for modules
jazzsequence May 14, 2025
3e5ee78
clear cache after install
jazzsequence May 14, 2025
c70f011
point to the correct location of the cert
jazzsequence May 14, 2025
19725bd
set the simplesamlphp config dir
jazzsequence May 14, 2025
1b132f9
set the environment variable in a mu-plugin rather than in the theme
jazzsequence May 14, 2025
f2fe84d
config updates
jazzsequence May 14, 2025
87352d2
fix filename typo
jazzsequence May 14, 2025
19328dd
rename the file to match the copy
jazzsequence May 14, 2025
76bc43c
create the authsources.php file on the fly
jazzsequence May 14, 2025
694895a
rename the base authsources file for phpunit
jazzsequence May 14, 2025
bf70df3
don't copy the file into simplesamlphp/ because that's where we're cr…
jazzsequence May 14, 2025
729c0fe
saml expects strings not arrays
jazzsequence May 14, 2025
a69f3d8
sanitize incoming auth attributes
jazzsequence May 14, 2025
66f2983
filter out any weird injected array attributes
jazzsequence May 14, 2025
1c03450
add metadata.sources
jazzsequence May 15, 2025
0dfd782
dynamically create a 2.x saml20-sp-remote.php file instead of the 1.1…
jazzsequence May 15, 2025
21448f6
remove the sed for the authsources
jazzsequence May 15, 2025
96bc832
use /files as the location for the tmp directory
jazzsequence May 15, 2025
b675165
set example-userpass as the default authentication
jazzsequence May 15, 2025
fc8db1a
add more config stuff
jazzsequence May 15, 2025
03c4896
add a debug file to try to debug the auth state
jazzsequence May 15, 2025
e9d11ee
fix filename typo
jazzsequence May 15, 2025
f5e7aee
fix path to include file
jazzsequence May 15, 2025
1fc3d40
fix the path to the sqlite store
jazzsequence May 15, 2025
ae775f0
use phpsession instead of sqlite
jazzsequence May 15, 2025
049a0f1
add some debugging and new config
jazzsequence May 15, 2025
996a301
debug is not a boolean
jazzsequence May 15, 2025
6e280b8
move auth.admin source and fix baseurlpath & update debugging
jazzsequence May 15, 2025
59228ef
undo that thing
jazzsequence May 15, 2025
7d8fbdd
support 1.x or 2.x autoload files
jazzsequence May 16, 2025
ec56c4c
define a constant instead of using putenv
jazzsequence May 16, 2025
106c53b
remove authstate debugging
jazzsequence May 16, 2025
c049ae8
restore sqlite data store
jazzsequence May 16, 2025
b8b329f
re-add sp-remote
jazzsequence May 16, 2025
23b5a5e
add default-sp to authsources.php dynamic file creation
jazzsequence May 16, 2025
970c9e1
dopy sp-remote (and don't copy debug_authstate)
jazzsequence May 16, 2025
f76d13b
copy routing, attributemap and lib
jazzsequence May 16, 2025
b2e56cc
remove default-sp definition
jazzsequence May 16, 2025
7d799b5
update functions.php
jazzsequence May 16, 2025
a0b044b
update the path to the loginuserpass twig file
jazzsequence May 16, 2025
b05e5ef
just sed the login button
jazzsequence May 16, 2025
56deb3d
the submit button is a button, not an input
jazzsequence May 16, 2025
620b117
replace Login with Submit
jazzsequence May 16, 2025
ed53913
remove the second submit
jazzsequence May 16, 2025
7bc7c69
modify the loginuserpass javascript file so behat can log in
jazzsequence May 16, 2025
9821e5a
also remove the button.disabled line
jazzsequence May 16, 2025
1543f5d
hack admin login behat helpers
jazzsequence May 16, 2025
5dc4afe
fix the behat tests actually
jazzsequence May 16, 2025
271bc02
add debugging
jazzsequence May 16, 2025
ff1752a
debug the else
jazzsequence May 16, 2025
1bf9dfd
try to simulate what the js does without js
jazzsequence May 19, 2025
b21a6dc
submit the postback form
jazzsequence May 19, 2025
f7563aa
be less restrictive about inputs
jazzsequence May 19, 2025
50eea19
use dom crawler
jazzsequence May 19, 2025
1ea3b21
bump version
jazzsequence May 19, 2025
535e546
add simplesamlphp note to upgrade notice
jazzsequence May 19, 2025
befdfd8
clean up linting for bash scripts
jazzsequence May 19, 2025
14cb653
run shellcheck linting
jazzsequence May 19, 2025
1217df4
update changelog
jazzsequence May 19, 2025
085c032
default to false
jazzsequence May 19, 2025
00aadfd
remove unnecessary else
jazzsequence May 19, 2025
043b046
don't run test-all-versions in ci
jazzsequence May 19, 2025
9064f76
Apply suggestions from code review
jazzsequence May 19, 2025
2006dee
Apply suggestions from code review
jazzsequence May 19, 2025
3ee5756
use exit, not return
jazzsequence May 19, 2025
edd2ffc
remove the test all versions scripts
jazzsequence May 19, 2025
aeeef9a
test all versions of simplesamlphp
jazzsequence May 19, 2025
32629f0
fix unclosed <<
jazzsequence May 19, 2025
a76c26e
fix the nightly job
jazzsequence May 19, 2025
8d02b29
send that export to the bash environment actually
jazzsequence May 19, 2025
a788ebb
put the conditional in the right place
jazzsequence May 19, 2025
b23a82b
remove stray `
jazzsequence May 19, 2025
748d61b
revert restore cache changes
jazzsequence May 20, 2025
2d20425
re-add files for 1.18 version of simplesaml
jazzsequence May 20, 2025
1dd866b
final shellcheck fixes for 1.18 script
jazzsequence May 20, 2025
69e67c4
temporarily disable cleanup so we can manually evaluate the update
jazzsequence May 20, 2025
1cdd1f3
also output what simplesaml version we're testing
jazzsequence May 20, 2025
0f78516
make the bars longer
jazzsequence May 20, 2025
87f3e23
copy required files/folders
jazzsequence May 20, 2025
e277331
set the download url as a variable
jazzsequence May 20, 2025
d490110
restore the link
jazzsequence May 20, 2025
f6bc1d6
remove the workflow wait after upgrading php version
jazzsequence May 20, 2025
500ab26
we need 1.18 versions of idp and sp files, too
jazzsequence May 20, 2025
5a83a58
BASH_DIR includes the 1.18 subdir
jazzsequence May 21, 2025
3482229
move the style.css up a dir
jazzsequence May 21, 2025
ceade3f
get the parent directory of bashdir
jazzsequence May 21, 2025
bbcab71
style.css is in /fixtures
jazzsequence May 21, 2025
9871a35
move the authsources.php.additions into the 1.18 subdir
jazzsequence May 21, 2025
a14ccd3
use a FIXTURES_DIR variable for non-1.18-specific things
jazzsequence May 21, 2025
6efe156
cd into fixture dir before copying wp-saml-auth plugin
jazzsequence May 21, 2025
b77e091
fix the typo in FIXTURES_DIR creating an infinite loop
jazzsequence May 21, 2025
75f92aa
go one directory higher
jazzsequence May 21, 2025
e3444a5
actually, using fixtures_dir here is confusing
jazzsequence May 21, 2025
74c16ea
just push dangit
jazzsequence May 21, 2025
83fd715
cleans up the logic for the admin notice
jazzsequence May 23, 2025
5dfcb98
bump required wp version
jazzsequence May 23, 2025
0b8b8ba
rename behat tests
jazzsequence May 23, 2025
704411d
test for 1.18 admin notice
jazzsequence May 23, 2025
cf0b237
PHPCBF: Fix coding standards
May 23, 2025
de3828c
change the paths and destination
jazzsequence May 23, 2025
6870faf
remove travis ci badge
jazzsequence May 23, 2025
00d5f82
/home/tester is the correct one
jazzsequence May 23, 2025
776018d
use CIRCLE_WORKING_DIRECTORY
jazzsequence May 23, 2025
1e9a5a8
remove tests for 2.3.7 simplesaml
jazzsequence May 23, 2025
5f008b9
add a lot more error handling
jazzsequence May 23, 2025
1207c43
okay fine DON'T use CIRCLE_WORKING_DIRECTORY
jazzsequence May 23, 2025
b2178af
update the behat syntax
jazzsequence May 23, 2025
fe20568
add behat test for 2.0.0
jazzsequence May 23, 2025
df88354
fix version identification
jazzsequence May 23, 2025
932f1df
update the comment
jazzsequence May 23, 2025
130004a
for 2.0.0, add additional tests
jazzsequence May 23, 2025
aa3b4e4
fix the path to the behat file
jazzsequence May 23, 2025
e97ef27
it's not security alert, it's security recommendation
jazzsequence May 23, 2025
ef11baf
do the cleanup
jazzsequence May 23, 2025
d13228f
delete 10 at a time
jazzsequence May 23, 2025
b9583e7
change error to warning
jazzsequence May 23, 2025
cb51fec
re-add the possible base paths to simplesaml
jazzsequence May 28, 2025
eb1194f
don't number the comments
jazzsequence May 28, 2025
c516244
catch exceptions and output to debug logs
jazzsequence May 28, 2025
b20974d
linting fixes
jazzsequence May 28, 2025
4fbd596
allow cleanup to fail without failing the workflow entirely
jazzsequence May 28, 2025
4c2de9b
refactor to use a get_simplesamlphp_autoloader method
jazzsequence May 28, 2025
2299bdd
refactor and update error handling
jazzsequence May 28, 2025
9c5e7fe
set_provider should use get_simplesamlphp_autoloader
jazzsequence May 28, 2025
ad23d5a
only run cleanup once if all three sets of behat tests pass
jazzsequence May 28, 2025
857a51a
use the filter first
jazzsequence May 28, 2025
121ff38
add documentation for new filters
jazzsequence May 28, 2025
6a88a5e
fix ci stuff
jazzsequence May 28, 2025
14c7f99
make sure to attach the workspace
jazzsequence May 28, 2025
9570312
(possibly) correctly attach workspace
jazzsequence May 28, 2025
113e1ea
name individual files correctly
jazzsequence May 28, 2025
146adfd
fix shellcheck warnings
jazzsequence May 28, 2025
f35a70c
flip upgrade notice so newer is higher
jazzsequence May 28, 2025
1ab4afd
use the variable we define earlier
jazzsequence May 29, 2025
72d1ef1
switch get_simplesamlphp_autoloader to a static method
jazzsequence May 30, 2025
75a03c4
use WP_SAML_Auth::get_simplesamlphp_autoloader for autoload path
jazzsequence May 30, 2025
a32be8a
refactor to use bootstrap process for WP SAML Auth plugin
jazzsequence May 30, 2025
a651de9
add recursion guard for autoloader option resolution and improve auto…
jazzsequence May 30, 2025
47bcecf
PHPCBF: Fix coding standards
May 30, 2025
b3ca1d7
add period
jazzsequence May 30, 2025
08b9c13
bump minimum supported wp version
jazzsequence May 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 116 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ workflows:
version: 2
main:
jobs:
- test-behat
- test-behat:
name: "Test with SimpleSAMLphp 1.18.0"
simplesamlphp_version: "1.18.0"
- test-behat:
name: "Test with SimpleSAMLphp 2.0.0"
simplesamlphp_version: "2.0.0"
- test-behat:
name: "Test with SimpleSAMLphp 2.4.0"
simplesamlphp_version: "2.4.0"
- test-phpunit:
name: "Test with PHP 7.4"
php_version: "7.4"
Expand All @@ -16,6 +24,11 @@ workflows:
- test-phpunit:
name: "Test with PHP 8.2"
php_version: "8.2"
- behat-cleanup:
requires:
- "Test with SimpleSAMLphp 1.18.0"
- "Test with SimpleSAMLphp 2.0.0"
- "Test with SimpleSAMLphp 2.4.0"
nightly:
triggers:
- schedule:
Expand All @@ -25,32 +38,57 @@ workflows:
only:
- master
jobs:
- test-behat
- test-behat:
name: "Test with SimpleSAMLphp 1.18.0"
simplesamlphp_version: "1.18.0"
- test-behat:
name: "Test with SimpleSAMLphp 2.0.0"
simplesamlphp_version: "2.0.0"
- test-behat:
name: "Test with SimpleSAMLphp 2.4.0"
simplesamlphp_version: "2.4.0"
- behat-cleanup:
requires:
- "Test with SimpleSAMLphp 1.18.0"
- "Test with SimpleSAMLphp 2.0.0"
- "Test with SimpleSAMLphp 2.4.0"
jobs:
test-behat:
parameters:
simplesamlphp_version:
type: enum
enum:
- "1.18.0"
- "2.0.0"
- "2.4.0"
working_directory: ~/pantheon-systems/wp-saml-auth
parallelism: 1
docker:
- image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2
steps:
- checkout
- restore_cache:
keys:
- test-behat-dependencies-{{ checksum "composer.json" }}
- run: composer install -n --prefer-dist
- save_cache:
key: test-behat-dependencies-{{ checksum "composer.json" }}
- composer-cache-v1-{{ checksum "composer.lock" }}
- composer-cache-v1-
- run:
name: Install Composer dependencies
command: composer install -n --prefer-dist
- save_cache: # Save composer's internal cache
key: composer-cache-v1-{{ checksum "composer.lock" }}
paths:
- vendor
- run: echo $(openssl rand -hex 8) > /tmp/WORDPRESS_ADMIN_PASSWORD
- run: |
echo 'export TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
echo 'export TERMINUS_SITE=wp-saml-auth' >> $BASH_ENV
echo 'export SITE_ENV=wp-saml-auth.ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_USERNAME=pantheon' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_EMAIL=no-reply@getpantheon.com' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_PASSWORD=$(cat /tmp/WORDPRESS_ADMIN_PASSWORD)' >> $BASH_ENV
source $BASH_ENV
- run:
name: Set environment variables
command: |
echo 'export TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
echo 'export TERMINUS_SITE=wp-saml-auth' >> $BASH_ENV
echo 'export SITE_ENV=wp-saml-auth.ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_USERNAME=pantheon' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_EMAIL=no-reply@getpantheon.com' >> $BASH_ENV
echo 'export WORDPRESS_ADMIN_PASSWORD=$(cat /tmp/WORDPRESS_ADMIN_PASSWORD)' >> $BASH_ENV
echo 'export SIMPLESAMLPHP_VERSION="<< parameters.simplesamlphp_version >>"' >> $BASH_ENV
source $BASH_ENV
- run: echo "StrictHostKeyChecking no" >> "$HOME/.ssh/config"
- run: |
if [ -z "$GITHUB_TOKEN" ]; then
Expand All @@ -67,12 +105,62 @@ jobs:
exit 0
fi
terminus auth:login --machine-token=$TERMINUS_TOKEN
- run: ./bin/validate-fixture-version.sh
- run: ./bin/behat-prepare.sh
- run: ./bin/behat-test.sh --strict
- run:
command: ./bin/behat-cleanup.sh
when: always
name: Save environment name for cleanup
command: |
echo "wp-saml-auth.ci-$CIRCLE_BUILD_NUM" > "/tmp/site_env_<< parameters.simplesamlphp_version >>.txt"
- persist_to_workspace:
root: /tmp
paths:
- "site_env_<< parameters.simplesamlphp_version >>.txt"
- run:
name: Validate fixture version
command: ./bin/validate-fixture-version.sh
- run:
name: Prepare and run Behat tests
command: |
set -e
source $BASH_ENV

# Prepare fixture environment for tests.
if [ << parameters.simplesamlphp_version >> != '1.18.0' ]; then
./bin/behat-prepare.sh
else
./bin/1.18/behat-prepare-simplesaml1.18.0.sh
fi

echo ""
echo "=========================================================================="
echo "Running Behat on https://${TERMINUS_ENV}-${TERMINUS_SITE}.pantheonsite.io/wp-login.php"
echo "with SimpleSAMLphp version $SIMPLESAMLPHP_VERSION"
echo "=========================================================================="
echo ""
./bin/behat-test.sh --strict
behat-cleanup:
docker:
- image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2
working_directory: ~/pantheon-systems/wp-saml-auth
steps:
- attach_workspace:
workspace: ~/workspace
at: /tmp/behat-envs
- checkout
- run:
name: Set environment variables
command: |
echo 'export TERMINUS_SITE=wp-saml-auth' >> $BASH_ENV
echo 'export TERMINUS_ENV=ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
echo 'export SITE_ENV=wp-saml-auth.ci-$CIRCLE_BUILD_NUM' >> $BASH_ENV
source $BASH_ENV
- run: |
if [ -z "$TERMINUS_TOKEN" ]; then
echo "TERMINUS_TOKEN environment variables missing; assuming unauthenticated build"
exit 0
fi
terminus auth:login --machine-token=$TERMINUS_TOKEN
- run:
name: Run Cleanup Script
command: ./bin/behat-cleanup.sh
test-phpunit:
parameters:
php_version:
Expand All @@ -94,7 +182,10 @@ jobs:
- restore_cache:
keys:
- test-phpunit-dependencies-{{ checksum "composer.json" }}
- run: composer update && composer install -n --prefer-dist
- run: |
composer update
composer install -n --prefer-dist
chmod +x bin/*.sh
- save_cache:
key: test-phpunit-dependencies-{{ checksum "composer.json" }}
paths:
Expand All @@ -110,12 +201,11 @@ jobs:
sudo docker-php-ext-enable imagick
sudo docker-php-ext-install mysqli
sudo apt-get install mariadb-client
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- run:
name: "Run Tests"
command: |
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
composer phpunit
WP_MULTISITE=1 composer phpunit
rm -rf $WP_TESTS_DIR $WP_CORE_DIR
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 nightly true
composer test:install:withdb
composer phpunit
10 changes: 10 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ jobs:
run: |
composer install
composer lint
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
run: |
shellcheck --version
shellcheck bin/*.sh
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ wp-cli.local.yml
/node_modules/
/simplesamlphp/
/vendor/

# PHPUnit Helpers
bin/helpers.sh
bin/install-wp-tests.sh
bin/install-local-tests.sh
bin/phpunit-test.sh
.phpunit*
Comment on lines +7 to +12
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ignores come from adding wpunit-helpers as a dependency.

51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# WP SAML Auth #
**Contributors:** [getpantheon](https://profiles.wordpress.org/getpantheon/), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [outlandish-josh](https://profiles.wordpress.org/outlandish-josh/), [jazzs3quence](https://profiles.wordpress.org/jazzs3quence/)
**Contributors:** [getpantheon](https://profiles.wordpress.org/getpantheon/), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [outlandish-josh](https://profiles.wordpress.org/outlandish-josh/), [jazzs3quence](https://profiles.wordpress.org/jazzs3quence/), [lcatlett](https://profiles.wordpress.org/lcatlett/)
**Tags:** authentication, SAML
**Requires at least:** 4.4
**Tested up to:** 6.3
**Requires at least:** 6.4
**Tested up to:** 6.8.1
**Requires PHP:** 7.3
**Stable tag:** 2.1.5-dev
**Stable tag:** 2.2.0-dev
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -40,6 +40,8 @@ If you're connecting directly to an existing IdP, you should use the bundled One

If you have more complex authentication needs, then you can also use a SimpleSAMLphp installation running in the same environment. These settings are not configurable through the WordPress backend; they'll need to be defined with a filter. And, if you have a filter in place, the WordPress backend settings will be removed.

**Note:** A security vulnerability was found in SimpleSAMLphp versions 2.0.0 and below. It is highly recommended if you are using SimpleSAMLphp with WP SAML Auth that you update your SimpleSAMLphp library to 2.4.0 or above. (See [CVE-2025-27773](https://nvd.nist.gov/vuln/detail/CVE-2025-27773) and [The SimpleSAMLphp SAML2 library incorrectly verifies signatures for HTTP-Redirect bindings](https://github.com/advisories/GHSA-46r4-f8gj-xg56) for more information.)

Additional explanation of each setting can be found in the code snippet below.

To install SimpleSAMLphp locally for testing purposes, the [Identity Provider QuickStart](https://simplesamlphp.org/docs/stable/simplesamlphp-idp) is a good place to start. On Pantheon, the SimpleSAMLphp web directory needs to be symlinked to `~/code/simplesaml` to be properly handled by Nginx. [Read the docs](https://pantheon.io/docs/shibboleth-sso/) for more details about configuring SimpleSAMLphp on Pantheon.
Expand Down Expand Up @@ -201,6 +203,28 @@ If you need to adapt authentication behavior based on the SAML response, you can
return $ret;
}, 10, 2 );

If you have installed SimpleSAMLphp to a non-default path, you can set that path via the `wp_saml_auth_simplesamlphp_path_array` filter. By default, it is assumed that SimpleSAMLphp is installed into one of the following paths:
* `ABSPATH . 'simplesaml'`
* `ABSPATH . 'private/simplesamlphp'`
* `ABSPATH . 'simplesamlphp'`

```php
add_filter( 'wp_saml_auth_simplesamlphp_path_array', function( $simplesamlphp_path_array ) {
// Override default paths with a defined path.
return [ ABSPATH . 'path/to/simplesamlphp' ];
}
```

You can also define an explicit path to the SimpleSAMLphp autoloader file (defaults to the `lib/_autoload.php` file under the SimpleSAMLphp path) with the `wp_saml_auth_ssp_autoloader` filter.

```php
add_filter( 'wp_saml_auth_ssp_autoloader', function( $ssp_autoloader ) {
if ( ! file_exists( $ssp_autoloader ) ) {
return ABSPATH . 'path/to/simplesamlphp/autoload.php';
}
}
```

## WP-CLI Commands ##

This plugin implements a variety of [WP-CLI](https://wp-cli.org) commands. All commands are grouped into the `wp saml-auth` namespace.
Expand Down Expand Up @@ -233,6 +257,16 @@ See [CONTRIBUTING.md](https://github.com/pantheon-systems/wp-saml-auth/blob/mast
### Reporting Security Bugs
Please report security bugs found in the WP SAML Auth plugin's source code through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/wp-saml-auth). The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.

## Security Requirements

### SimpleSAMLphp Version

If you're using the SimpleSAMLphp connection type:
- **Critical Security Requirement:** Version 2.0.0 or later is required to fix CVE-2023-26881 (XML signature validation bypass vulnerability).
- **Recommended Security Requirement:** Version 2.3.7 or later is recommended for additional security fixes.
- Authentication will be blocked for versions below 2.0.0 when "Enforce Security Requirements" is enabled.
- It's always recommended to use the latest stable version of SimpleSAMLphp for security and compatibility.
Comment thread
jazzsequence marked this conversation as resolved.

## Frequently Asked Questions ##

### Can I update an existing WordPress user's data when they log back in? ###
Expand Down Expand Up @@ -272,13 +306,20 @@ There is no third step. Because SimpleSAMLphp loads WordPress, which has WP Nati

## Upgrade Notice ##

### 2.2.0 ###
WP SAML Auth 2.2.0 requires WordPress version 6.4 or later.

SimpleSAMLphp recommended version is 2.3.7 or later for `simplesamlphp` SAML authentication type. With "Enforce Security Requirements" enabled, SimpleSAMLphp versions below 2.0.0 will be blocked. 2.0.0 or later is required to fix CVE-2023-26881 (XML signature validation bypass vulnerability).

### 2.0.0 ###
Minimum supported PHP version is 7.3.

## Changelog ##

### 2.1.5-dev ###
### 2.2.0-dev ###
* Add a hook to modify returned attributes. [[#379](https://github.com/pantheon-systems/wp-saml-auth/pull/379/)] (props @anthonybaxter-uwu)
* Updates [`onelogin/php-saml`](https://github.com/SAML-Toolkits/php-saml) to 4.2.0. [[#402](https://github.com/pantheon-systems/wp-saml-auth/pull/402/)]
* Adds warnings and the option to disable SAML when using a vulnerable version of simplesamlphp [[#402](https://github.com/pantheon-systems/wp-saml-auth/pull/402/)]

### 2.1.4 (November 27, 2023) ###
* Fix typo in the label for the certificate path [[#352](https://github.com/pantheon-systems/wp-saml-auth/pull/352)]
Expand Down
13 changes: 13 additions & 0 deletions bin/1.18/1-adminnotice.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Admin Notice for SimpleSAMLphp 1.18 Vulnerability
In order to ensure administrators are aware of critical security issues
As a site administrator
I need to see an admin notice regarding the SimpleSAMLphp vulnerability

Scenario: Admin user sees the SimpleSAMLphp vulnerability notice
Given I log in as an admin
Then I should be on "/wp-admin/"
And I should see "Security Alert:" in the "div.notice.notice-error[data-slug='wp-saml-auth'][data-type='simplesamlphp-critical-vulnerability']" element
And I should see "The SimpleSAMLphp version used by the WP SAML Auth plugin (1.18.4) has a critical security vulnerability (CVE-2023-26881). Please update to version 2.0.0 or later. Learn more." in the "div.notice.notice-error[data-slug='wp-saml-auth'][data-type='simplesamlphp-critical-vulnerability'] p" element
And I go to "/wp-admin/options-general.php"
Then I should see "Security Alert:" in the "div.notice.notice-error[data-slug='wp-saml-auth'][data-type='simplesamlphp-critical-vulnerability']" element
And I should see "The SimpleSAMLphp version used by the WP SAML Auth plugin (1.18.4) has a critical security vulnerability (CVE-2023-26881)" in the "div.notice.notice-error[data-slug='wp-saml-auth'] p" element
Loading