mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 23:11:27 +09:00
[Docs] api docs
This commit is contained in:
parent
3c5db3c1fd
commit
4deb032708
3 changed files with 33 additions and 7 deletions
|
|
@ -76,10 +76,20 @@ class CsrfChecker:
|
||||||
resp_nonce = self.get_query_param(loc, param) if param else None
|
resp_nonce = self.get_query_param(loc, param) if param else None
|
||||||
|
|
||||||
if resp_nonce is None:
|
if resp_nonce is None:
|
||||||
report_vuln(title="CSRF Risk", desc="Missing nonce in redirect response", status="CRITICAL", uri=flow.request.url)
|
report_vuln(
|
||||||
|
title="CSRF Risk",
|
||||||
|
desc="Missing nonce in redirect response",
|
||||||
|
status="CRITICAL",
|
||||||
|
uri=flow.request.url
|
||||||
|
)
|
||||||
return 1
|
return 1
|
||||||
if orig_nonce != resp_nonce:
|
if orig_nonce != resp_nonce:
|
||||||
report_vuln(title="CSRF Risk", desc="Nonce mismatch request↔response", status="HIGH", uri=flow.request.url)
|
report_vuln(
|
||||||
|
title="CSRF Risk",
|
||||||
|
desc="Nonce mismatch request↔response",
|
||||||
|
status="HIGH",
|
||||||
|
uri=flow.request.url
|
||||||
|
)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
@ -103,7 +113,12 @@ class CsrfChecker:
|
||||||
if new_nonce is None:
|
if new_nonce is None:
|
||||||
return 0
|
return 0
|
||||||
if new_nonce == orig_nonce:
|
if new_nonce == orig_nonce:
|
||||||
report_vuln(title="CSRF Risk", desc="Nonce reused without cookies", status="CRITICAL", uri=flow.request.url)
|
report_vuln(
|
||||||
|
title="CSRF Risk",
|
||||||
|
desc="Nonce reused without cookies",
|
||||||
|
status="CRITICAL",
|
||||||
|
uri=flow.request.url
|
||||||
|
)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# (2) 두 번의 리다이렉트 비교
|
# (2) 두 번의 리다이렉트 비교
|
||||||
|
|
@ -120,7 +135,12 @@ class CsrfChecker:
|
||||||
and urlparse(req1.headers.get("location", "")).path
|
and urlparse(req1.headers.get("location", "")).path
|
||||||
== urlparse(req2.headers.get("location", "")).path
|
== urlparse(req2.headers.get("location", "")).path
|
||||||
):
|
):
|
||||||
report_vuln(title="CSRF Risk", desc="Identical redirects on nonce swap → potential CSRF", status="NOT-VERIFIED-HIGH", uri=flow.request.url)
|
report_vuln(
|
||||||
|
title="CSRF Risk",
|
||||||
|
desc="Identical redirects on nonce swap → potential CSRF",
|
||||||
|
status="NOT-VERIFIED-HIGH",
|
||||||
|
uri=flow.request.url
|
||||||
|
)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
@ -130,7 +150,12 @@ class CsrfChecker:
|
||||||
|
|
||||||
# 1) 요청에 nonce 없으면
|
# 1) 요청에 nonce 없으면
|
||||||
if is_oauth_uri(flow.request.url) and not self.check_nonce_in_request(flow):
|
if is_oauth_uri(flow.request.url) and not self.check_nonce_in_request(flow):
|
||||||
report_vuln(title="CSRF Risk", desc="Missing nonce in OAuth request", status="CRITICAL", uri=flow.request.url)
|
report_vuln(
|
||||||
|
title="CSRF Risk",
|
||||||
|
desc="Missing nonce in OAuth request",
|
||||||
|
status="CRITICAL",
|
||||||
|
uri=flow.request.url
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
# 2) 리다이렉트에서 nonce 검사
|
# 2) 리다이렉트에서 nonce 검사
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ class FalseTrueVarifingTask:
|
||||||
self._is_verifing = False
|
self._is_verifing = False
|
||||||
self.task_queue.clear()
|
self.task_queue.clear()
|
||||||
|
|
||||||
|
# 각 addon의 검증 로직에서 해당 함수를 호출하여, 추후 오탐 검증을 위한 작업을 추가할 수 있습니다.
|
||||||
def add_task(self, task_name: str, data: Any):
|
def add_task(self, task_name: str, data: Any):
|
||||||
"""
|
"""
|
||||||
Add a task to the task queue.
|
Add a task to the task queue.
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ async def start(url: str = Query(..., description="The URL to target for vulnera
|
||||||
"/start-false-true-verifing",
|
"/start-false-true-verifing",
|
||||||
summary="시스템에 False-True 검증 작업 시작을 알림",
|
summary="시스템에 False-True 검증 작업 시작을 알림",
|
||||||
description="""
|
description="""
|
||||||
이 엔드포인트는 시스템에 False-True 방식의 검증 작업을 시작하도록 지시합니다.
|
이 엔드포인트는 시스템에 False-True 방식의 검증 작업이 시작되었음을 알립니다.
|
||||||
또한 검증을 위해 준비된 작업 목록을 반환합니다.
|
또한 시스템은 미리 준비된 오탐 검증 작업 목록을 반환합니다.
|
||||||
""",
|
""",
|
||||||
tags=["2nd STEP"]
|
tags=["2nd STEP"]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue