Repository navigation
fix(security): remove deep-research search/fetch tools (GHSA-j7p8-g5m6-3wv5) - #162
Merged
Merged
Conversation
…6-3wv5) The openai_deep_research module cached Meta Ads records in a module-level singleton keyed only by "<type>:<id>". Under streamable-http one process serves every caller, and fetch read that cache with no credential resolution and no ownership check, so any caller could read another caller's cached account, campaign, ad, page and business records. Removed rather than scoped: in production every fetch call already failed (70% "Record not found", the rest schema-validation errors from clients treating it as a generic Graph fetch), and the hosted MCP replaces search with its own implementation, so there was no working behaviour to preserve. Regression tests assert neither tool is registered again. Also bumps to 1.0.122 and documents the advisory in SECURITY.md.
nictuku
force-pushed
the
fix/ghsa-j7p8-g5m6-3wv5
branch
from
September 22, 2026 15:58
fce7047 to
fb14394
Compare
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.
Fixes GHSA-j7p8-g5m6-3wv5, reported by @BarakSrour.
The bug
openai_deep_research.pycached Meta Ads records in a module-levelMetaAdsDataManagersingleton keyed only by"<type>:<id>"— no caller, session or tenant component, no eviction.searchwrote to it under the calling user's credential;fetchread it back with no credential resolution and no ownership check. Under--transport streamable-http, where one process serves every caller, any caller holding a syntactically-valid bearer token could read another caller's cached ad-account, campaign, ad, page and business records — name, currency, total spend, balance, and the raw Graph objects.fetchnever calls Graph, so nothing downstream validated the reader's token either.Why removal instead of scoping the cache
Production traffic over the last 7 days: 178
fetchcalls from 72 users, 0 of them successful. 124 returned "Record not found"; the rest were schema-validation errors from clients passingurl/path/params, i.e. treatingfetchas a generic Graph fetcher. The hosted MCP already filters the Pythonsearchout oftools/listand substitutes its own implementation, so the cache it fed was never populated there.There was no working behaviour left to preserve. Per-caller cache keys would have kept the machinery, the memory growth and the next version of this bug for a tool nobody successfully uses.
Changes
meta_ads_mcp/core/openai_deep_research.pyand its registration incore/__init__.pyandcore/server.py.test_integration_openai_mcp.py,test_openai_mcp_deep_research.py,test_account_search.py— the latter two are manual scripts against a local server).tests/test_deep_research_tools_removed.py: asserts the module is unimportable, thatsearch/fetchare not registered MCP tools, and that neighbouring tools survived.README.md: drop themcp_meta_ads_searchentry.SECURITY.md.Client impact
Callers that used the deep-research pair should use the typed tools:
get_ad_accounts,get_campaigns,get_campaign_details,get_adsets,get_ads,get_ad_details. Hosted users are unaffected — the hostedsearchis the Next.js implementation and stays.Full suite: 545 passed, 9 skipped.