Skip to content

v2.46.0

Choose a tag to compare

@github-actions github-actions released this 20 Aug 12:49
· 514 commits to main since this release

๐Ÿ” Authentik ForwardAuth ๋กœ๊ทธ์ธ์ด ๋˜์ง€ ์•Š๋˜ ๋ฌธ์ œ

์ต์Šคํ”Œ๋กœ์ž‡ ์ฐจ๋‹จ์ด Authentik ๋กœ๊ทธ์ธ ํ™”๋ฉด์œผ๋กœ ๊ฐ€๋Š” ๊ธธ์„ ๋ง‰๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค

ํ”„๋ก์‹œ ํ˜ธ์ŠคํŠธ์— Authentik ForwardAuth๋ฅผ ์—ฐ๊ฒฐํ•˜๊ณ  ์ต์Šคํ”Œ๋กœ์ž‡ ์ฐจ๋‹จ(Block Exploits) ์„ ์ผœ ๋‘์…จ๋‹ค๋ฉด, ๋ณดํ˜ธ๋œ ์ฃผ์†Œ์— ์ ‘์†ํ–ˆ์„ ๋•Œ ๋กœ๊ทธ์ธ ํ™”๋ฉด ๋Œ€์‹  403์ด ๋–ด์Šต๋‹ˆ๋‹ค. ๋‘ ๊ธฐ๋Šฅ ๋ชจ๋‘ ๊ธฐ๋ณธ๊ฐ’์ด ์ผœ์ง์ด๋ผ, ์กฐํ•ฉ์„ ๋งŒ๋“ค๋ฉด ๋ฐ”๋กœ ์žฌํ˜„๋˜๋Š” ์ƒํƒœ์˜€์Šต๋‹ˆ๋‹ค.

์›์ธ์€ NPG ์ž์‹ ์ด ๋งŒ๋“  ์ฃผ์†Œ์˜€์Šต๋‹ˆ๋‹ค. ๋ฏธ์ธ์ฆ ์š”์ฒญ์„ Authentik์œผ๋กœ ๋ณด๋‚ผ ๋•Œ NPG๋Š” ์›๋ž˜ ์ฃผ์†Œ๋ฅผ ?rd=https://... ํ˜•ํƒœ๋กœ ๋ถ™์—ฌ ์ฃผ๋Š”๋ฐ, ๋‚ด์žฅ ์ฐจ๋‹จ ๊ทœ์น™ ์ค‘ "URL Parameter Injection (RFI)" ์ด ์ •ํ™•ํžˆ ์ด๋ฆ„=https:// ํŒจํ„ด์„ ๋ง‰์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด ๊ฒ€์‚ฌ๋Š” ๊ฐœ๋ณ„ ๊ฒฝ๋กœ๋ณด๋‹ค ๋จผ์ € ๋„๋Š” ์ž๋ฆฌ์— ์žˆ์–ด์„œ, Authentik ์ „์šฉ ๊ฒฝ๋กœ๋ฅผ ๋”ฐ๋กœ ๋‘์—ˆ๋Š”๋ฐ๋„ ๊ทธ ์•ž์—์„œ ์ž˜๋ ธ์Šต๋‹ˆ๋‹ค.

Authelia๋Š” ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ์ฃผ์†Œ๋ฅผ Authelia ์ชฝ์ด ๋งŒ๋“ค์–ด ์ฃผ๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์—†์—ˆ์Šต๋‹ˆ๋‹ค.

์ด์ œ NPG๊ฐ€ ๊ทธ ์ฃผ์†Œ๋ฅผ ๋งŒ๋“ค ๋•Œ :// ๋ฅผ ์ธ์ฝ”๋”ฉํ•ด์„œ ๋„˜๊น๋‹ˆ๋‹ค. ์ฐจ๋‹จ ๊ทœ์น™์€ ๊ทธ๋Œ€๋กœ ๋‘์—ˆ๊ณ , Authentik์ด ๋ฐ›๋Š” ๊ฐ’๋„ ์ด์ „๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ ^/outpost.goauthentik.io ๋ฅผ ์ต์Šคํ”Œ๋กœ์ž‡ ์˜ˆ์™ธ์— ๋„ฃ์–ด ๋‘์…จ๋‹ค๋ฉด ์ง€์šฐ์…”๋„ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ ์˜ˆ์™ธ๋Š” ํ•ด๋‹น ๊ฒฝ๋กœ์˜ ๊ฒ€์‚ฌ๋ฅผ ํ†ต์งธ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ฒŒ ํ•˜๋ฏ€๋กœ, ์—†๋Š” ํŽธ์ด ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

์ œ๋ณดํ•ด ์ฃผ์‹  @four2mis ๋‹˜ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. (#265)


๐Ÿ” ํ‘œ์ค€์ด ์•„๋‹Œ ํฌํŠธ๋ฅผ ์“ฐ๋ฉด ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ์— ๋‚ด๋ถ€ ํฌํŠธ๊ฐ€ ์ƒˆ๋˜ ๋ฌธ์ œ

๊ณต์œ ๊ธฐ์—์„œ 443์„ ๋‹ค๋ฅธ ํฌํŠธ(์˜ˆ: 18443)๋กœ ๋„˜๊ฒจ NPG๋ฅผ ์šด์˜ํ•˜๋Š” ๊ตฌ์„ฑ์—์„œ, NPG๊ฐ€ ๋งŒ๋“  ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ์ฃผ์†Œ์— ๋ฐ–์—์„œ๋Š” ๋‹ฟ์„ ์ˆ˜ ์—†๋Š” ๋‚ด๋ถ€ ํฌํŠธ๊ฐ€ ๋ถ™์—ˆ์Šต๋‹ˆ๋‹ค. ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๊ทธ ์ฃผ์†Œ๋ฅผ ๋”ฐ๋ผ๊ฐ€๋ฉด ๊ทธ๋Œ€๋กœ ๋ฉˆ์ท„์Šต๋‹ˆ๋‹ค.

nginx๋Š” ์ƒ๋Œ€ ๊ฒฝ๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ๋ฅผ ์ ˆ๋Œ€ ์ฃผ์†Œ๋กœ ๋ฐ”๊ฟ” ์ค„ ๋•Œ ์ž๊ธฐ๊ฐ€ ๋“ฃ๊ณ  ์žˆ๋Š” ํฌํŠธ๋ฅผ ๋ถ™์ž…๋‹ˆ๋‹ค. ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๋ณด๋‚ธ ์ฃผ์†Œ์—๋Š” ํฌํŠธ๊ฐ€ ์—†์—ˆ๋Š”๋ฐ๋„ nginx๊ฐ€ ์Šค์Šค๋กœ :18443 ์„ ์ฑ„์›Œ ๋„ฃ์€ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

Authentik ๋กœ๊ทธ์ธ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ์—์„œ ์ฒ˜์Œ ๋ฐœ๊ฒฌ๋์ง€๋งŒ ๊ฑฐ๊ธฐ์— ํ•œ์ •๋œ ๋ฌธ์ œ๊ฐ€ ์•„๋‹ˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ง€์˜ค ์ฐจ๋‹จ ์ฑŒ๋ฆฐ์ง€ ํ™”๋ฉด, ๊ทธ๋ฆฌ๊ณ  ๋ฐฑ์—”๋“œ๊ฐ€ ๋ณด๋‚ด์˜จ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ๋ฅผ NPG๊ฐ€ ๋‹ค์‹œ ์จ ์ฃผ๋Š” ๋ชจ๋“  ํ”„๋ก์‹œ ํ˜ธ์ŠคํŠธ๊ฐ€ ๊ฐ™์€ ์˜ํ–ฅ์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.

์ด์ œ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ์ฃผ์†Œ๋ฅผ ์ƒ๋Œ€ ๊ฒฝ๋กœ ๊ทธ๋Œ€๋กœ ๋‚ด๋ณด๋ƒ…๋‹ˆ๋‹ค. ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ํ˜„์žฌ ์ฃผ์†Œ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์•Œ์•„์„œ ์™„์„ฑํ•˜๋ฏ€๋กœ, ๋ฐ–์—์„œ ๋“ค์–ด์˜จ ์ ‘์†์—๋Š” ํฌํŠธ๊ฐ€ ๋ถ™์ง€ ์•Š๊ณ  LAN์—์„œ :18443 ์œผ๋กœ ์ง์ ‘ ์ ‘์†ํ•˜๋˜ ๊ฒฝ์šฐ์—๋Š” ๊ทธ ํฌํŠธ๊ฐ€ ๊ทธ๋Œ€๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค.

์ž„์‹œ ์กฐ์น˜๋กœ ์ „์—ญ ์„ค์ •์˜ custom_http_config ์— absolute_redirect off; / port_in_redirect off; ๋ฅผ ๋„ฃ์–ด ๋‘์…จ๋‹ค๋ฉด ๋ฐ˜๋“œ์‹œ ์ง€์›Œ ์ฃผ์„ธ์š”. ์ด์ œ NPG๊ฐ€ absolute_redirect off ๋ฅผ ์ง์ ‘ ๋‚ด๋ณด๋‚ด๋ฏ€๋กœ ๊ฐ™์€ ์ง€์‹œ์–ด๊ฐ€ ๋‚จ์•„ ์žˆ์œผ๋ฉด ์„ค์ • ๊ฒ€์‚ฌ๊ฐ€ ์ค‘๋ณต ์˜ค๋ฅ˜๋กœ ์‹คํŒจํ•˜๊ณ , port_in_redirect off; ๋Š” ํฌํŠธ๋กœ ์ง์ ‘ ์ ‘์†ํ•˜๋Š” ๊ฒฝ๋กœ๋ฅผ ๊ณ„์† ๊นจ๋œจ๋ฆฝ๋‹ˆ๋‹ค.

์ œ๋ณดํ•ด ์ฃผ์‹  @four2mis ๋‹˜ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. (#264)


๐Ÿšฆ Rate Limit ์˜ˆ์™ธ IP๊ฐ€ ์ด๋ฒˆ ๋ฒ„์ „๋ถ€ํ„ฐ ์‹ค์ œ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค

์†”์งํ•˜๊ฒŒ ๋ง์”€๋“œ๋ฆฝ๋‹ˆ๋‹ค: Rate Limit์˜ "์˜ˆ์™ธ/ํ™”์ดํŠธ๋ฆฌ์ŠคํŠธ IP" ํ•ญ๋ชฉ์€ ์ง€๊ธˆ๊นŒ์ง€ ์–ด๋–ค ๋ฒ„์ „์—์„œ๋„ ๋™์ž‘ํ•œ ์ ์ด ์—†์Šต๋‹ˆ๋‹ค. ๊ฐ’์€ ์ €์žฅ๋˜๊ณ , ํ™”๋ฉด์—๋„ ๋ณด์ด๊ณ , ๋ฐฑ์—…์—๋„ ๋“ค์–ด๊ฐ”์ง€๋งŒ, nginx ์„ค์ •์œผ๋กœ๋Š” ํ•œ ๋ฒˆ๋„ ๋ Œ๋”๋ง๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์ „์—ญ ๊ธฐ๋ณธ๊ฐ’๊ณผ ํ˜ธ์ŠคํŠธ๋ณ„ ์„ค์ • ๋ชจ๋‘ ๋งˆ์ฐฌ๊ฐ€์ง€์˜€์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๋ฒ„์ „๋ถ€ํ„ฐ ๋“ฑ๋กํ•˜์‹  IP์™€ ๋Œ€์—ญ(CIDR)์ด ์ •๋ง๋กœ rate limit์—์„œ ๋ฉด์ œ๋ฉ๋‹ˆ๋‹ค. ์‰ผํ‘œยท์ค„๋ฐ”๊ฟˆ ์–ด๋А ์ชฝ์œผ๋กœ ๊ตฌ๋ถ„ํ•ด๋„ ๋˜๊ณ , 10.1.2.3/8 ์ฒ˜๋Ÿผ ์“ด ๋Œ€์—ญ์€ 10.0.0.0/8 ๋กœ ์•Œ์•„์„œ ์ •๊ทœํ™”๋˜๋ฉฐ, # ๋ฉ”๋ชจ ๋ฅผ ๋’ค์— ๋ถ™์—ฌ๋„ ๋ฉ๋‹ˆ๋‹ค.

ํ•จ๊ป˜ ๊ณ ์นœ ๊ฒƒ๋“ค์ž…๋‹ˆ๋‹ค.

  • ์ €์žฅํ•  ๋•Œ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค. IP๋‚˜ CIDR์ด ์•„๋‹Œ ๊ฐ’์€ 400์œผ๋กœ ๊ฑฐ์ ˆํ•˜๊ณ  ์–ด๋–ค ๊ฐ’์ด ๋ฌธ์ œ์ธ์ง€ ์•Œ๋ ค ์ค๋‹ˆ๋‹ค. ์ด์ „ ๋ฒ„์ „์—์„œ ์ €์žฅ๋œ ์ž˜๋ชป๋œ ๊ฐ’์ด ์žˆ์–ด๋„ ์„ค์ • ์ƒ์„ฑ ์‹œ ๊ฑด๋„ˆ๋›ฐ๋ฏ€๋กœ nginx๊ฐ€ ๋ฉˆ์ถ”๋Š” ์ผ์€ ์—†์Šต๋‹ˆ๋‹ค.
  • ํ˜ธ์ŠคํŠธ๋ณ„ ์˜ˆ์™ธ ๋ชฉ๋ก์„ ๋น„์šธ ์ˆ˜ ์žˆ๊ฒŒ ๋์Šต๋‹ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€๋Š” ํ•œ ๋ฒˆ ์ €์žฅํ•˜๋ฉด ํ™”๋ฉด์—์„œ ์ง€์›Œ๋„ ์ €์žฅ์†Œ์—๋Š” ์˜› ๊ฐ’์ด ๋˜์‚ด์•„๋‚˜, ์‚ฌ์‹ค์ƒ ์ง€์šธ ์ˆ˜ ์—†์—ˆ์Šต๋‹ˆ๋‹ค.
  • ์ „์—ญ Rate Limit ์„ค์ •์—์„œ ๋‹ค๋ฅธ ํ•ญ๋ชฉ๋งŒ ๋ฐ”๊ฟ€ ๋•Œ ์˜ˆ์™ธ ๋ชฉ๋ก์ด ์กฐ์šฉํžˆ ์‚ฌ๋ผ์ง€๋˜ ๋ฌธ์ œ๋„ ํ•จ๊ป˜ ๊ณ ์ณค์Šต๋‹ˆ๋‹ค.

ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์˜ˆ์™ธ IP๋ฅผ ๋“ฑ๋กํ•ด ๋‘์…จ๋˜ ๋ถ„์€, ๊ทธ ์ฃผ์†Œ๋“ค์ด ์ง€๊ธˆ๊นŒ์ง€๋Š” ์ œํ•œ์„ ๋ฐ›๊ณ  ์žˆ์—ˆ๊ณ  ์—…๊ทธ๋ ˆ์ด๋“œ ํ›„๋ถ€ํ„ฐ ์ •๋ง๋กœ ๋ฉด์ œ๋ฉ๋‹ˆ๋‹ค. ๋ชฉ๋ก์— ๋‚จ์•„ ์žˆ๋Š” ๊ฐ’์ด ์ง€๊ธˆ๋„ ์˜๋„์— ๋งž๋Š”์ง€ ํ•œ ๋ฒˆ ์‚ดํŽด๋ด ์ฃผ์„ธ์š”. ์ฐธ๊ณ ๋กœ ์ด ๋ชฉ๋ก์€ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์‹ ๊ณ ํ•˜๋Š” ์ฃผ์†Œ(X-Forwarded-For ๋ฐ˜์˜ ํ›„)๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•˜๋ฏ€๋กœ, ๋‚ด๋ถ€๋ง์—์„œ ํ—ค๋”๋ฅผ ์œ„์กฐํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์ด๋ผ๋ฉด ์‹ ๋ขฐ ๊ฒฝ๊ณ„ ์•ˆ์—์„œ๋งŒ ์‚ฌ์šฉํ•˜์‹œ๊ธธ ๊ถŒํ•ฉ๋‹ˆ๋‹ค.

#258 ์„ ์กฐ์‚ฌํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ฐœ๊ฒฌํ•ด ๋ณ„๋„ ์ด์Šˆ๋กœ ๋ถ„๋ฆฌํ•œ ๊ฑด์ž…๋‹ˆ๋‹ค. (#263)


๐Ÿ”‘ ๊ด€๋ฆฌ ํŒจ๋„์ด ์ž๊ธฐ ์ž์‹ ์„ ์ž ๊ทธ๋˜ ๋ฌธ์ œ

NPG ๊ด€๋ฆฌ ํ™”๋ฉด์„ NPG ์ž์‹ ์„ ํ†ตํ•ด ํ”„๋ก์‹œ๋กœ ์šด์˜ํ•˜๋Š” ๊ตฌ์„ฑ์—์„œ, ํŒจ๋„์„ ๋ช‡ ๋ฒˆ ์˜ค๊ฐ€๋‹ค ๋ณด๋ฉด ๊ฐ‘์ž๊ธฐ 429๊ฐ€ ์Ÿ์•„์ง€๊ณ  ์‹ฌํ•˜๋ฉด ๋กœ๊ทธ์ธ ํ™”๋ฉด์—์„œ "Rate limit exceeded"๊ฐ€ ๋–  ๋กœ๊ทธ์ธ ์ž์ฒด๊ฐ€ ๋ง‰ํ˜”์Šต๋‹ˆ๋‹ค.

์›์ธ์€ ํ”„๋ก์‹œ ํ˜ธ์ŠคํŠธ์˜ rate limit์ด ์•„๋‹ˆ๋ผ NPG API ์ž์ฒด์˜ IP๋‹น ๋ถ„๋‹น 100ํšŒ ์ œํ•œ์ด์—ˆ์Šต๋‹ˆ๋‹ค. ํ˜ธ์ŠคํŠธ ๋ชฉ๋ก์€ ํ–‰๋งˆ๋‹ค ์ƒํƒœ ํ™•์ธ ์š”์ฒญ์„ ๋ณด๋‚ด๊ณ  ์„œ๋ฅธ ๊ฐœ ๊ฐ€๊นŒ์šด ํ™”๋ฉด์ด ์ฃผ๊ธฐ์ ์œผ๋กœ ๊ฐฑ์‹  ์š”์ฒญ์„ ๋ณด๋‚ด๋‹ˆ, ํŒจ๋„ ํ˜ผ์ž์„œ ์˜ˆ์‚ฐ์„ ๋‹ค ์จ ๋ฒ„๋ฆฝ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋กœ๊ทธ์ธ ์š”์ฒญ๊นŒ์ง€ ๊ฐ™์€ ์˜ˆ์‚ฐ์„ ์“ฐ๊ณ  ์žˆ์–ด์„œ, ์˜ˆ์‚ฐ์ด ๋ฐ”๋‹ฅ๋‚˜๋ฉด ๋‹ค์‹œ ๋“ค์–ด์˜ฌ ๋ฐฉ๋ฒ•์ด ์—†์—ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ๋ฐ”๋€๋‹ˆ๋‹ค.

  • ๋กœ๊ทธ์ธ์€ ๋ณ„๋„ ์˜ˆ์‚ฐ์„ ์”๋‹ˆ๋‹ค. ํŒจ๋„์ด ์•„๋ฌด๋ฆฌ ๋ฐ”๋น ๋„ ๋กœ๊ทธ์ธ ํ™”๋ฉด์€ ๋ง‰ํžˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • ์ผ๋ฐ˜ API ์˜ˆ์‚ฐ์€ IP๋‹น ๋ถ„๋‹น 100 โ†’ 600 ์œผ๋กœ ์˜ฌ๋ ธ์Šต๋‹ˆ๋‹ค. ํŒจ๋„์ด ์ •์ƒ ์‚ฌ์šฉ์œผ๋กœ ๋„๋‹ฌํ•  ์ˆ˜ ์—†๋Š” ์ˆ˜์ค€์ž…๋‹ˆ๋‹ค.
  • ํ•„์š”ํ•˜๋ฉด .env ์—์„œ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: API_RATE_LIMIT_PER_MINUTE (0์ด๋ฉด ๋”), AUTH_RATE_LIMIT_PER_MINUTE. ๋กœ๊ทธ์ธ ์ชฝ์€ ๋ฌด์ฐจ๋ณ„ ๋Œ€์ž…์„ ๋ง‰๋Š” ๋ธŒ๋ ˆ์ดํฌ์ด๋ฏ€๋กœ ๋‚ฎ๊ฒŒ ์œ ์ง€ํ•˜์‹œ๊ธธ ๊ถŒํ•ฉ๋‹ˆ๋‹ค.
  • API๊ฐ€ ๋ณด๋‚ด๋Š” 429 ์‘๋‹ต์— ์ด๊ฒƒ์ด NPG API ์ž์ฒด์˜ ์ œํ•œ์ด๋ผ๋Š” ํ‘œ์‹œ(code: "api_rate_limit")๋ฅผ ๋„ฃ์—ˆ์Šต๋‹ˆ๋‹ค.

๋กœ๊ทธ ํ™”๋ฉด์˜ "Rate Limit" ๋ผ๋ฒจ๋„ ์ •ํ™•ํ•ด์กŒ์Šต๋‹ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€๋Š” ๋ฐฑ์—”๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ๋Œ๋ ค์ค€ 429๊นŒ์ง€ ์ „๋ถ€ "Rate Limit"์œผ๋กœ ํ‘œ์‹œํ•ด์„œ, ์ด๋ฒˆ ๊ฑด์ฒ˜๋Ÿผ ์›์ธ์„ ์—‰๋šฑํ•œ ๊ณณ์—์„œ ์ฐพ๊ฒŒ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ nginx๊ฐ€ ์ง์ ‘ ์ฐจ๋‹จํ•œ ์š”์ฒญ(์—…์ŠคํŠธ๋ฆผ์— ๋„๋‹ฌํ•˜์ง€ ์•Š์€ 429)๋งŒ ๊ทธ๋ ‡๊ฒŒ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฏธ ๊ธฐ๋ก๋œ ๊ณผ๊ฑฐ ๋กœ๊ทธ์˜ ๋ผ๋ฒจ์€ ๋ฐ”๋€Œ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์Šคํฌ๋ฆฐ์ƒท๊ณผ ํ•จ๊ป˜ ๋ˆ์งˆ๊ธฐ๊ฒŒ ํ™•์ธํ•ด ์ฃผ์‹  @ydrob ๋‹˜ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. (#258)


๐Ÿงน ํ•จ๊ป˜ ์ •๋ฆฌํ•œ ๊ฒƒ๋“ค

  • ํ˜ธ์ŠคํŠธ ๋ณต์ œ ์‹œ Rate Limit "์ „์—ญ ๊ธฐ๋ณธ๊ฐ’ ์‚ฌ์šฉ ์•ˆ ํ•จ" ์„ค์ •์ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€๋Š” ๋ณต์ œ๋ณธ์ด ์กฐ์šฉํžˆ ์ „์—ญ rate limit์„ ๋‹ค์‹œ ๋ฌผ๋ ค๋ฐ›์•˜์Šต๋‹ˆ๋‹ค.
  • TRUSTED_PROXY_CIDR ๊ฐ€ ์‹ค์ œ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. ํด๋ผ์ด์–ธํŠธ IP๋ฅผ ํŒ๋ณ„ํ•  ๋•Œ ์‹ ๋ขฐํ•  ํ”„๋ก์‹œ ๋Œ€์—ญ์„ ์ œํ•œํ•˜๋Š” ์„ค์ •์ธ๋ฐ, ์ด๋ฆ„๋งŒ ์žˆ๊ณ  ์ฝํžˆ์ง€ ์•Š๋Š” ์ƒํƒœ์˜€์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ๋™์ž‘(์‚ฌ์„ค๋ง ์‹ ๋ขฐ)์€ ๊ทธ๋Œ€๋กœ์ด๋ฉฐ, ๊ฐ’์„ ์ง€์ •ํ•˜๋ฉด loopback + ์ง€์ • ๋Œ€์—ญ๋งŒ ์‹ ๋ขฐํ•ฉ๋‹ˆ๋‹ค โ€” ๊ฐ™์€ ๋‚ด๋ถ€๋ง์˜ ๋‹ค๋ฅธ ๊ธฐ๊ธฐ๊ฐ€ ์ž๊ธฐ ์ฃผ์†Œ๋ฅผ ์†์—ฌ ๋ณด๊ณ ํ•˜๋Š” ๊ฒƒ์„ ๋ง‰๊ณ  ์‹ถ์„ ๋•Œ ์“ฐ์„ธ์š”. ๋กœ๊ทธ์ธ ์ž ๊ธˆยท๊ฐ์‚ฌ ๋กœ๊ทธยทrate limit ํ‚ค๊ฐ€ ๋ชจ๋‘ ์ด ๊ฐ’์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.
  • ์„ธ์…˜์ด ๋งŒ๋ฃŒ๋์„ ๋•Œ ํ™”๋ฉด์ด ํ•œ ๋ฒˆ๋งŒ ์ƒˆ๋กœ๊ณ ์นจ๋ฉ๋‹ˆ๋‹ค. ์ด์ „์—๋Š” ์ง„ํ–‰ ์ค‘์ด๋˜ ์š”์ฒญ ์ˆ˜๋งŒํผ ์ƒˆ๋กœ๊ณ ์นจ์ด ๊ฒน์ณ ์˜ˆ์•ฝ๋๊ณ , ์œ„ API ์ œํ•œ๊ณผ ๊ฒน์น˜๋ฉด ์„œ๋กœ๋ฅผ ์•…ํ™”์‹œ์ผฐ์Šต๋‹ˆ๋‹ค.

apiยทui ์ด๋ฏธ์ง€๋ฅผ ๋ชจ๋‘ ๋ฐ›์•„ ๋‹ค์‹œ ์˜ฌ๋ ค ์ฃผ์„ธ์š”. ์„ค์ •์€ ์‹œ์ž‘ ์‹œ ์ž๋™์œผ๋กœ ๋‹ค์‹œ ๋งŒ๋“ค์–ด์ง€๋ฏ€๋กœ ํ˜ธ์ŠคํŠธ๋ฅผ ๋‹ค์‹œ ์ €์žฅํ•˜์‹ค ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.

docker compose pull && docker compose up -d

๐Ÿ” Authentik ForwardAuth logins were failing

Exploit blocking was blocking the path to Authentik's own login page

If you attached Authentik ForwardAuth to a proxy host and left Block Exploits on, visiting a protected address returned 403 instead of the login page. Both settings default to on, so the combination alone reproduced it.

The address NPG itself generates was the cause. When handing an unauthenticated request to Authentik, NPG appends the original address as ?rd=https://... โ€” and one of the built-in rules, "URL Parameter Injection (RFI)", blocks exactly the name=https:// shape. That check runs before individual paths are matched, so the dedicated Authentik path never got a chance.

Authelia was unaffected because Authelia builds that redirect address itself.

NPG now encodes the :// when it builds the address. The blocking rule is unchanged, and what Authentik receives is unchanged.

If you already added ^/outpost.goauthentik.io to your exploit exceptions, you can remove it. That exception skips exploit checking for the path entirely, so you are safer without it.

Thanks to @four2mis for the report. (#265)


๐Ÿ” A non-standard port leaked into redirect URLs

If you run NPG behind a router that forwards 443 to a different port (18443, for example), redirects NPG produced carried an internal port that is not reachable from outside. Browsers following them just hung.

When nginx turns a relative redirect into an absolute address, it appends the port it is listening on. Even though the browser's own address had no port in it, nginx filled in :18443 by itself.

It surfaced on the Authentik login redirect, but it was never limited to that. The geo-blocking challenge page, and every proxy host where NPG rewrites a redirect coming back from the backend, were affected the same way.

Redirect addresses are now emitted as relative paths. The browser completes them against the address it is already on โ€” so requests arriving from outside get no port, while a LAN client that really did connect on :18443 keeps that port.

If you worked around this with absolute_redirect off; / port_in_redirect off; in custom_http_config, you must remove it. NPG now emits absolute_redirect off itself, so a duplicate line fails the config test โ€” and a leftover port_in_redirect off; keeps direct-by-port access broken.

Thanks to @four2mis for the report. (#264)


๐Ÿšฆ Rate limit exception IPs actually work now

Being honest with you: the rate limit "exception / whitelist IPs" field has never worked, in any version. The value was stored, shown in the UI and carried through backups โ€” but it was never rendered into nginx configuration. That was true for both the global default and per-host overrides.

From this version, the IPs and CIDR ranges you register are genuinely exempt from rate limiting. Commas and newlines both work as separators, a range written as 10.1.2.3/8 is normalized to 10.0.0.0/8, and a trailing # note is allowed.

Fixed along the way:

  • Values are validated on save. Anything that is not an IP or CIDR is rejected with a 400 that names the offending entry. Invalid values saved by earlier versions are skipped at config-generation time, so they cannot break nginx.
  • Per-host exception lists can finally be cleared. Until now, once saved, clearing the field brought the old value back โ€” it was effectively permanent.
  • Updating other fields of the Global Rate Limit no longer silently wipes the exception list.

Please check your list. If you had exception IPs registered, those addresses were being rate-limited all along and become genuinely exempt after upgrading. Also note the list matches the client address after X-Forwarded-For processing, so treat it as trustworthy only within your network's trust boundary.

Found while investigating #258 and split out separately. (#263)


๐Ÿ”‘ The admin panel could lock itself out

If you proxy the NPG admin panel through NPG itself, a busy session could suddenly return a wall of 429s โ€” and at worst, the login screen showed "Rate limit exceeded" and you could not sign back in.

The cause was not a proxy host rate limit but NPG's own API limit of 100 requests per minute per IP. The host list probes every row, nearly thirty screens poll on timers โ€” the panel spends that budget by itself. And because login shared the same budget, once it was gone there was no way back in.

What changes:

  • Signing in has its own budget. However busy the panel is, the login screen stays reachable.
  • The general API budget rose from 100 to 600 per minute per IP โ€” beyond what the panel can reach through normal use.
  • Both are tunable in .env: API_RATE_LIMIT_PER_MINUTE (0 disables), AUTH_RATE_LIMIT_PER_MINUTE. Keep the auth one low; it is a brake on credential stuffing.
  • The API's 429 response now identifies itself (code: "api_rate_limit") so it can no longer be mistaken for a proxy host rate limit.

The log viewer's "Rate Limit" label is accurate now, too. It used to tag every 429 that way โ€” including ones returned by your backend application โ€” which is exactly what sent this investigation in the wrong direction at first. Now only requests nginx itself blocked (429 with no upstream) get the label. Already-recorded rows keep their old label.

Thanks to @ydrob for the persistent, screenshot-backed follow-up. (#258)


๐Ÿงน Housekeeping

  • Cloning a host now keeps its Rate Limit "disable global default" setting. Copies used to silently pick the global rate limit back up.
  • TRUSTED_PROXY_CIDR now actually works. It restricts which peers count as trusted proxy hops when resolving the client IP; the variable existed but was never read. The default (trusting private networks) is unchanged โ€” set it to close the documented limit where another machine on your LAN can spoof its reported address. Login lockout, audit logs and rate-limit keys all follow this value.
  • Session expiry reloads the page once, not once per in-flight request โ€” previously this compounded with the API limit above.

Pull both the api and ui images and restart. Configuration is regenerated at startup โ€” no need to re-save your hosts.

docker compose pull && docker compose up -d

Docker Images

docker pull svrforum/nginxproxyguard-api:2.46.0
docker pull svrforum/nginxproxyguard-ui:2.46.0
docker pull svrforum/nginxproxyguard-nginx:2.46.0

Architectures: linux/amd64, linux/arm64

Component Status
API Built
UI Built
Nginx Skipped (no changes)