
Cloud Vulnerability DB
A community-led vulnerabilities database
SkillsClient uses the same default headers for GitHub archive downloads and
skills.sh searches. Its constructor adds an Authorization: Bearer ... header
from SkillsClientConfig.github_token or the ambient GITHUB_TOKEN environment
variable. Consequently, calling search() sends that GitHub credential to
https://skills.sh/api/search as well.
This reproduces on main commit
5125cb5dfcc99aa3c31ca248cb734c63628a99dd (the checkout declares AG2 1.3.0).
The published v1.3.0 tag contains the identical affected client.py blob
(50e2edf9c79fcf5feaebdb5f0388da310163dc1f). Earlier versions have not been
assessed, so the complete affected release range remains to be established.
The higher-level SkillSearchToolkit also uses SkillsClient.search(), so a
user can encounter this while discovering skills, without downloading one.
github_token or GITHUB_TOKEN.Save the following as reproduce.py. It calls the public
SkillsClient.search() method using dummy credentials. RESPX intercepts the
real HTTPX request construction and rejects unmatched requests. It tests both
configuration and environment sources without sending traffic to an external
service.
import asyncio
import os
from unittest.mock import patch
import httpx
import respx
from ag2.tools.skills.skill_search.client import SkillsClient
from ag2.tools.skills.skill_search.config import SkillsClientConfig
async def main():
for source in ("config", "environment"):
with patch.dict(os.environ, {"GITHUB_TOKEN": "dummy-env-token"}):
config = SkillsClientConfig(github_token="dummy-config-token") if source == "config" else None
client = SkillsClient(config)
with respx.mock(assert_all_mocked=True, assert_all_called=True) as router:
search = router.get("https://skills.sh/api/search").mock(
return_value=httpx.Response(200, json={"skills": []})
)
await client.search("example")
request = search.calls.last.request
print(f"{source}: destination={request.url.host}, authorization_present={'authorization' in request.headers}")
asyncio.run(main())Run from an affected checkout with its dependencies and RESPX installed:
PYTHONPATH=. python /path/to/reproduce.pyObserved on the unmodified baseline:
config: destination=skills.sh, authorization_present=True
environment: destination=skills.sh, authorization_present=TrueExpected: both values are False; GitHub archive downloads should still receive
the configured credential.
Keep the resolved GitHub token separate from common headers. Construct the
download-specific headers in download_skill(), adding the token there only.
Use httpx.Headers.setdefault() so an explicitly supplied Authorization header
retains precedence and HTTP header names are handled case-insensitively.
This does not change the documented SkillsClientConfig.headers option: headers
explicitly supplied through that option still apply to every request. The fix
specifically isolates the automatically generated GitHub authentication header.
The shared header mapping is never mutated by a download.
Existing HTTPX cross-host redirect behavior continues to remove Authorization
when the archive request redirects to the separate download host.
The production change in ag2/tools/skills/skill_search/client.py is:
@@
- token = cfg.github_token or os.environ.get("GITHUB_TOKEN")
- if token:
- self._headers["Authorization"] = f"Bearer {token}"
+ self._github_token = cfg.github_token or os.environ.get("GITHUB_TOKEN")
@@
with tempfile.TemporaryDirectory() as tmp_dir:
tar_path = Path(tmp_dir) / "skill.tar.gz"
hash_obj = hashlib.sha256()
+ headers = httpx.Headers(self._headers)
+ if self._github_token:
+ headers.setdefault("Authorization", f"Bearer {self._github_token}")
async with (
- self._make_client(timeout=120) as client,
+ self._make_client(timeout=120, headers=headers) as client,The patch and tests are prepared locally, and I am happy to contribute the fix and respond to review. No public issue, branch, or PR has been published. Please advise whether you prefer a private advisory patch or another private review workflow before public disclosure. I will coordinate the public disclosure timing with you.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."