Created
May 27, 2012 20:57
-
-
Save mnaberez/2815882 to your computer and use it in GitHub Desktop.
MySQL triggers that prevent phpBB3's "Allow PHP code in templates" option from being enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TRIGGER phpbb_config_insert_tpl_allow_php; | |
DROP TRIGGER phpbb_config_update_tpl_allow_php; | |
DELIMITER ;; | |
CREATE TRIGGER phpbb_config_insert_tpl_allow_php BEFORE INSERT ON phpbb_config FOR EACH ROW | |
IF (NEW.config_name = 'tpl_allow_php') THEN | |
SET NEW.config_value = 0; | |
SET NEW.is_dynamic = 0; | |
END IF;; | |
CREATE TRIGGER phpbb_config_update_tpl_allow_php BEFORE UPDATE ON phpbb_config FOR EACH ROW | |
IF (NEW.config_name = 'tpl_allow_php') THEN | |
SET NEW.config_value = 0; | |
SET NEW.is_dynamic = 0; | |
END IF;; | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the phpBB3 admin panel is compromised, the attacker can enable the "Allow PHP code in templates" option and then inject malicious PHP code by editing the templates. These MySQL triggers prevent that option from being enabled by the admin panel.