////

Defensive parsing for protocol, header, and path inputs

Defensive parsing for protocol, header, and path inputs

////

Summary#

Defensive parsing for protocol, header, and path inputs

Problem#

Framework code that trusts malformed request metadata or uses naive string matching can crash, mis-parse directives, or open security gaps.

Solution#

Parse structured inputs token-by-token instead of with substring checks, treat invalid numeric metadata as safe defaults, and use safe path join helpers for extracted archives or user-controlled paths. Add regression tests for malformed but realistic inputs.

Failure Modes#

  • Using substring checks for cache-control directives and matching unintended superstrings
  • Blindly casting CONTENT_LENGTH and raising unhandled exceptions on malformed values
  • Using naive split/strip logic that leaves edge whitespace or tokenization bugs
  • Joining extracted archive paths without traversal-safe normalization

Sources#

  • https://github.com/fastapi/fastapi/pull/15721
  • https://github.com/fastapi/fastapi/pull/15723
  • https://github.com/fastapi/fastapi/pull/15720
  • https://github.com/fastapi/fastapi/pull/15722
  • https://github.com/fastapi/fastapi/pull/15719
  • https://github.com/fastapi/fastapi/pull/15724
  • https://github.com/react/react/pull/36173
  • https://github.com/react/react/pull/36727
  • https://github.com/react/react/pull/36726
  • https://github.com/django/django/pull/21424
  • https://github.com/django/django/pull/21300
  • https://github.com/django/django/pull/21440
  • https://github.com/django/django/pull/21426
  • https://github.com/django/django/pull/21408
  • https://github.com/django/django/pull/21439
  • https://github.com/django/django/pull/21436
  • https://github.com/django/django/pull/21441
  • https://github.com/django/django/pull/21438
  • https://github.com/django/django/pull/21427
  • https://github.com/django/django/pull/21437
  • https://github.com/django/django/pull/20583
  • https://github.com/kubernetes/kubernetes/pull/137767
  • https://github.com/kubernetes/kubernetes/pull/139087
  • https://github.com/kubernetes/kubernetes/pull/139358
  • https://github.com/kubernetes/kubernetes/pull/139378
  • https://github.com/kubernetes/kubernetes/pull/139557
  • https://github.com/kubernetes/kubernetes/pull/136886
  • https://github.com/kubernetes/kubernetes/pull/139194
  • https://github.com/kubernetes/kubernetes/pull/139193
  • https://github.com/kubernetes/kubernetes/pull/139192
  • https://github.com/kubernetes/kubernetes/pull/136695
  • https://github.com/kubernetes/kubernetes/pull/139533
  • https://github.com/kubernetes/kubernetes/pull/139599
  • mined_at: 2026-06-10T16:04:31Z

Sagwan Revalidation 2026-06-10T16:12:24Z#

  • verdict: ok
  • note: 방어적 파싱·안전한 경로 결합 권장은 현재도 표준 관행과 부합합니다.

Sagwan Revalidation 2026-06-11T18:16:25Z#

  • verdict: ok
  • note: 방어적 파싱·안전 경로 조인은 최신 관행과도 부합해 재사용 가능.

Sagwan Revalidation 2026-06-12T18:34:19Z#

  • verdict: ok
  • note: 일반적 보안 파싱 권장안으로 최신 practice와 충돌 없음

Sagwan Revalidation 2026-06-13T19:43:29Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 practice와 충돌 없이 여전히 재사용 가능함

Sagwan Revalidation 2026-06-14T20:23:02Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 현재 관행과 맞고 재사용 가능함

Sagwan Revalidation 2026-06-15T22:01:42Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합하며 재사용 가능함

Sagwan Revalidation 2026-06-16T22:25:21Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 맞고 전날 검증 이후 변동 근거 없음

Sagwan Revalidation 2026-06-17T22:30:34Z#

  • verdict: ok
  • note: 방어적 파싱·안전한 경로 결합 권장은 현재도 유효하다.

Sagwan Revalidation 2026-06-18T23:00:36Z#

  • verdict: ok
  • note: 일반 방어적 파싱 권장으로 최신 관행과 충돌 없이 재사용 가능

Sagwan Revalidation 2026-06-20T00:17:25Z#

  • verdict: ok
  • note: 일반적 방어적 파싱 권장안으로 최신 practice와 충돌 없음

Sagwan Revalidation 2026-06-21T01:08:36Z#

  • verdict: ok
  • note: 방어적 파싱 권장과 사례는 최근 기준에서도 여전히 유효함

Sagwan Revalidation 2026-06-22T01:24:33Z#

  • verdict: ok
  • note: 전날 검증 이후 일반적 방어적 파싱 권장안은 여전히 유효함

Sagwan Revalidation 2026-06-23T01:54:10Z#

  • verdict: ok
  • note: [chatgpt HTTP 401] {

Sagwan Revalidation 2026-06-24T02:07:23Z#

  • verdict: ok
  • note: [chatgpt HTTP 401] {

Sagwan Revalidation 2026-06-25T04:22:45Z#

  • verdict: ok
  • note: [chatgpt HTTP 401] {

Sagwan Revalidation 2026-06-26T05:25:13Z#

  • verdict: ok
  • note: 일반적 방어적 파싱 권장으로 최신 practice와 충돌 없어 보입니다.

Sagwan Revalidation 2026-06-27T09:32:42Z#

  • verdict: ok
  • note: 전날 검증 이후 변동 가능성 낮고 방어적 파싱 권장도 여전히 유효함

Sagwan Revalidation 2026-06-28T10:00:13Z#

  • verdict: ok
  • note: 일반적 보안 파싱 권장안으로 최신 practice와 충돌 없어 재사용 가능

Sagwan Revalidation 2026-06-29T11:22:52Z#

  • verdict: ok
  • note: 일반적 방어적 파싱 권장으로 수치·기술 노후화 징후가 없습니다.

Sagwan Revalidation 2026-06-30T14:53:38Z#

  • verdict: ok
  • note: 전날 검증 이후 변동 가능성 낮고 방어적 파싱 권장안은 여전히 유효함

Sagwan Revalidation 2026-07-01T22:38:00Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합하며 재사용 가능함

Sagwan Revalidation 2026-07-03T11:01:21Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합하며 재사용 가능함

Sagwan Revalidation 2026-07-04T19:16:04Z#

  • verdict: ok
  • note: 방어적 파싱과 경로 정규화 권장은 최신 관행과 부합하며 재사용 가능.

Sagwan Revalidation 2026-07-05T23:50:32Z#

  • verdict: ok
  • note: 일반적 방어 파싱 권장으로 최신 관행과 충돌 없고 재사용 가능함

Sagwan Revalidation 2026-07-07T05:23:47Z#

  • verdict: ok
  • note: 일반적 방어적 파싱 권고로 최근 practice와 충돌하지 않는다

Sagwan Revalidation 2026-07-08T11:58:56Z#

  • verdict: ok
  • note: 일반적 방어적 파싱 권장으로 최신 관행과 충돌 없어 재사용 가능

Sagwan Revalidation 2026-07-10T13:26:59Z#

  • verdict: ok
  • note: 원칙과 권장안이 보편적이며 이전 검증 후 변동 가능성이 낮음

Sagwan Revalidation 2026-07-12T06:57:25Z#

  • verdict: ok
  • note: 방어적 파싱 권장과 실패 모드는 여전히 일반적으로 유효하다.

Sagwan Revalidation 2026-07-14T02:48:55Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최근 관행과 일치하며 즉시 수정 필요 없음

Sagwan Revalidation 2026-07-16T03:21:56Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합하며 변경 필요가 없습니다.

Sagwan Revalidation 2026-07-18T05:15:41Z#

  • verdict: ok
  • note: 일반적 방어 파싱 권장안으로 최신 practice와 충돌 없어 재사용 가능

Sagwan Revalidation 2026-07-20T05:59:26Z#

  • verdict: ok
  • note: 방어적 파싱 원칙과 권장안은 현재 practice와도 부합한다.

Sagwan Revalidation 2026-07-22T08:25:30Z#

  • verdict: ok
  • note: 수치 의존이 없고 방어적 파싱 권장안은 현 practice와 부합함

Sagwan Revalidation 2026-07-24T10:37:01Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합하며 변경 근거가 없다.

Sagwan Revalidation 2026-07-26T13:06:59Z#

  • verdict: ok
  • note: 원칙 중심 내용으로 최근 practice와 충돌 없고 재사용 가능함

Sagwan Revalidation 2026-07-28T20:14:47Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 부합해 변경 필요가 낮음

Sagwan Revalidation 2026-07-31T01:54:20Z#

  • verdict: ok
  • note: 방어적 파싱 권장안은 최신 관행과 충돌 없고 재사용 가능함

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1