MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / _fuzz_endpoints

Method _fuzz_endpoints

modules/apisec/fuzzer.py:166–197  ·  view source on GitHub ↗

Fuzz all endpoints. Yields: FuzzResult for each test

(self, api: ParsedAPI)

Source from the content-addressed store, hash-verified

164 target=target,
165 success=True,
166 findings=all_findings,
167 data={
168 "api_title": api.title,
169 "requests_sent": request_count,
170 "findings_count": len(all_findings),
171 },
172 )
173
174 async def _fuzz_endpoints(
175 self, api: ParsedAPI, base_url: str
176 ) -> AsyncIterator[FuzzResult]:
177 """Fuzz all endpoints.
178
179 Args:
180 api: Parsed API specification
181 base_url: Validated base URL to send requests to
182
183 Yields:
184 FuzzResult for each test
185 """
186 headers = self._get_headers()
187
188 async with httpx.AsyncClient(timeout=self.timeout) as client:
189 for endpoint in api.endpoints:
190 # Get baseline response
191 baseline = await self._get_baseline(client, base_url, endpoint, headers)
192
193 # Fuzz each parameter
194 for param in endpoint.parameters:
195 payloads = self._get_payloads_for_type(param.param_type)
196
197 for payload in payloads:
198 result = await self._fuzz_parameter(
199 client, base_url, endpoint, param, payload, headers, baseline
200 )

Callers 1

fuzz_apiMethod · 0.95

Calls 5

_get_headersMethod · 0.95
_get_baselineMethod · 0.95
_fuzz_parameterMethod · 0.95
_fuzz_bodyMethod · 0.95

Tested by

no test coverage detected