[Refactor and Enhance] addon init.py의 비동기 작업을 더욱 효율적으로 수행

This commit is contained in:
tv0924@icloud.com 2025-06-26 19:07:35 +09:00
commit 0d81fdd49f
7 changed files with 58 additions and 155 deletions

View file

@ -12,18 +12,16 @@ class ScopeDetection:
return scope_values[0]
return None
async def check_scope(self, flow):
async def test(self, flow):
if not is_oauth_uri(flow.request.pretty_url):
return
req = flow.request
res = flow.response
parsed = urlparse(req.pretty_url)
query = parsed.query
location = res.headers.get("Location", "")
location_query = urlparse(location).query
query_scope = self.get_scope_from_query(query)
location_scope = self.get_scope_from_query(location_query)
if query_scope in ["all", "*"]:
report_vuln(
@ -32,17 +30,3 @@ class ScopeDetection:
status="WARNING",
uri=req.pretty_url
)
if location_scope in ["all", "*"]:
report_vuln(
title="OAuth Scope Value Issue",
desc=f"Scope value issue detected in response location: {location_scope}",
status="WARNING",
uri=location
)
async def test(self, flow):
if not is_oauth_uri(flow.request.pretty_url):
return
await self.check_scope(flow)