[INS-444] Fix verification logic in Mesibo detector#4884
Open
mustansir14 wants to merge 4 commits intomainfrom
Open
[INS-444] Fix verification logic in Mesibo detector#4884mustansir14 wants to merge 4 commits intomainfrom
mustansir14 wants to merge 4 commits intomainfrom
Conversation
MuneebUllahKhan222
requested changes
Apr 20, 2026
Contributor
MuneebUllahKhan222
left a comment
There was a problem hiding this comment.
Just need to address this one small change. Otherwise the PR is as good as it gets.
shahzadhaider1
approved these changes
Apr 20, 2026
MuneebUllahKhan222
approved these changes
Apr 20, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c8f5f59. Configure here.
mariduv
approved these changes
Apr 20, 2026
alafiand
approved these changes
Apr 20, 2026
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.

Problem
The Mesibo detector was incorrectly marking unverified secrets as verified. The original implementation sent a
GETrequest tohttps://api.mesibo.com/api.php?op=useradd&token=<token>and checked whether the response body contained the string"AUTHFAIL". This endpoint no longer works correctly — it now returns 502 on all requests, meaning the"AUTHFAIL"string is never present and every candidate token is marked as verified regardless of its validity. Even setting aside the broken endpoint, checking for a specific error string in the body is an unreliable verification strategy compared to inspecting a structured response field.Fix
Switched to the current Mesibo backend API (
POST https://api.mesibo.com/backend) as documented at https://docs.mesibo.com/api/backend-api/.The backend API always returns HTTP 200. The actual outcome is encoded in the JSON response body via a
codefield, which contains an RFC 9110 compliant HTTP status code. We probe using theuseraddoperation:code: 400.401).The verification logic was refactored into a dedicated
verify()method that:op=useraddand the candidate token.apiResponsestruct.trueonly ifcode == 400.All errors are wrapped with context using
fmt.Errorf(..., %w)and surfaced viaSetVerificationError.Tests
Added a test case
"found, verification error on 502"to the integration test suite usingcommon.ConstantResponseHttpClient(502, "")to simulate an unexpected HTTP status from the API, asserting that the result is unverified and a verification error is set.Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Medium Risk
Changes live secret verification behavior and external API interaction; incorrect interpretation of Mesibo response codes could flip verified/unverified results, but the scope is limited to this detector and is covered by tests.
Overview
Mesibo secret verification is rewritten to use the documented backend API (
POST https://api.mesibo.com/backend) and to decide validity via the JSONcodefield (treating400as auth succeeded and401as unverified) instead of string-matchingAUTHFAILfrom the deprecatedapi.phpendpoint.The detector now encapsulates verification in a dedicated
verify()method, supports injecting an HTTP client onScanner, and surfaces unexpected HTTP/response conditions viaSetVerificationError. Integration tests are updated to usego-cmpand add coverage for a verification-error scenario (simulated502).Reviewed by Cursor Bugbot for commit 52cedea. Bugbot is set up for automated code reviews on this repo. Configure here.