Fix BlockIP visibility and IndexBot method in Api - #10
Open
VitalD wants to merge 1 commit into
Open
Conversation
WAFSystem calls Api::BlockIP on isBas detection, but BlockIP was private and referenced non-existent IndexBot::isIndexbot(), causing a PHP error instead of blacklisting the IP. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Api::BlockIPpublic — it is called fromWAFSystemwhenisBasis detected; asprivatethis throws a PHP error and the BAS block path never blacklists the IP.IndexBot::isIndexbot()withIndexBot::Checking()—isIndexbotdoes not exist; withindexbot_checkerenabled the same path fatals on an undefined method.Context
When
data['isBas']is true,WAFSystem::isAllowed2does:Observed on current
master(includes/Api.class.php).Test plan
isBas=truepath viaxhr.phpfunc=checkswith IndexBot disabled — expect JSONblockand IP added to blacklist (no PHP Error about private method).indexbot_checker.enabled = Onfor a non-indexer IP — expect blacklist +block(no undefinedisIndexbot).Checking()accepts — expect no blacklist add, stillblockresponse from caller.allow/captchaflows unchanged.