naibaandnaiba/CloudCode fb120074ac chore(security): pin JWT algorithm + SameSite and harden OAuth2 state cookie
- Set GinJWTMiddleware.SigningAlgorithm to "HS256" explicitly so a future
  library default change (or an alg:none confusion attempt) cannot weaken
  token validation. This matches the current gin-jwt default, so behaviour
  is unchanged.
- Set CookieSameSite to Lax: same as the modern-browser default, but
  pinned so server-side intent is clear and CSRF on cross-site POST is
  blocked while top-level GET (OAuth callback) still works.
- Move the nz-o2s OAuth2 state cookie into writeOauth2StateCookie and
  set HttpOnly=true. The frontend does not read this cookie, so HttpOnly
  is strictly an XSS-hardening win with no behaviour change.

JWT Cookie HttpOnly/Secure are intentionally left default for now: the
frontend reads \`!!document.cookie\` to display login state and many
deployments terminate TLS at an upstream proxy — flipping those would
require a coordinated frontend change.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:17:59 +00:00
2025-02-28 22:19:57 +08:00
2025-02-09 14:39:12 +08:00
2025-03-22 22:44:25 +08:00
2021-01-30 11:22:59 +08:00
2026-02-15 13:13:33 +08:00
2021-03-22 17:41:38 +08:00
2026-03-01 11:33:11 +08:00
2022-04-18 10:47:29 +08:00



LOGO designed by 熊大 .

GitHub release (with filter)   Translation status

:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.

Supports monitoring system status, HTTP (SSL certificate change, upcoming expiration, expired), TCP, Ping and supports push alerts, run scheduled tasks and web terminal.

>> Telegram Channel: 哪吒监控(中文通知频道)
>> Telegram Group: Nezha Monitoring Global (English Only), 哪吒监控(中文群组)

>> Use Cases | 我们的用户 (Google)

User Guide

Contributing

Translation

Translation status

Is Nezha not in your language, or the translation is incorrect or incomplete? Get involved in the translations on Hosted Weblate.

Screenshots

用户前台 @hamster1963 管理后台 @nezhahq
user admin
hamster1963/nezha-dash nezhahq/admin-frontend

add your theme to service/singleton/frontend-templates.yaml

Contributors

naiba

UUBulb Akkia 卖女孩的小火柴 nap0o 黑歌 xykt Weblate (bot) MikoyChinese JackieSung4ev Kris Lemoe spiritlhl 刘颜溪 CosmosZ-code Ko no dio Kris Mmx233 rootmelo92118 Moraxyc Xu 1ridic 仓鼠 zhucaidan Sean lyj fscarmen windingFlame JSker9 Hsukqi Lee Darc Z. Creling Core F adminsama Acgpiano eya46 guoyongchang hiDandelion honeok IYUANWEIZE igophper lvyaoting quanljh unclezs 缘生 严浩 凌 榆木 93 Tony TomyJan Tater Li Tao Chen Spetrum NikoCat233 Nanjing Hopefun Network Technology Co. Ltd. Mingzhuo Yin Martijn Lindeman Leon KorenKrita Ian Li YiPing Zhang Esdese :D Coming

Special Thanks

  • IPInfo for providing an accurate GeoIP Database.

Star History

Star History Chart

S
Description
No description provided
Readme Apache-2.0
57 MiB
Languages
Go 99.3%
Shell 0.5%
PowerShell 0.2%