security: add allowed_classes => false to unserialize() in brute-force protection#1289
Open
XananasX7 wants to merge 1 commit into
Open
security: add allowed_classes => false to unserialize() in brute-force protection#1289XananasX7 wants to merge 1 commit into
XananasX7 wants to merge 1 commit into
Conversation
The brute-force protection stores invalid login attempts as serialized PHP data in a temporary file: array<ip_address, [expiry_time, count]>. These are plain arrays of integers — no objects are stored. Without allowed_classes, an attacker who can write to the temp directory (e.g., via a path traversal or symlink attack on the temp file path) can plant a malicious serialized payload that gets instantiated when Adminer reads the brute-force data. allowed_classes => false closes this vector with no behavior change.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
auth.inc.phpreads serialized brute-force tracking data from temp files and passes it tounserialize()without specifyingallowed_classes.The stored data structure is
array<ip_address, [expiry_time, count]>— plain arrays of integers. There's no reason for objects here.Without the restriction, an attacker who can write to the temp directory (e.g., through a path traversal or a symlink attack on the temp file path) can plant a serialized object payload that gets instantiated when Adminer reads its brute-force protection data.
Fix
Added
['allowed_classes' => false]to bothunserialize()calls inauth.inc.php. Zero behavior change for valid data.