mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 06:31:51 +09:00
[Refactor and Enhance] addon init.py의 비동기 작업을 더욱 효율적으로 수행
This commit is contained in:
parent
58d5deb435
commit
0d81fdd49f
7 changed files with 58 additions and 155 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue