mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #104] [MERGED] Security and Bug Fixes #158
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/104
Author: @mrigankad
Created: 2/20/2026
Status: ✅ Merged
Merged: 2/20/2026
Merged by: @asdek
Base:
master← Head:fix/security-and-bugs📝 Commits (3)
8c1f5e7Security and Bug Fixes6ba22d6Reviewer-requested changes: remove server-side password change block and adjust scraper timeoutec4a24dRemove .claude folder and add to .gitignore📊 Changes
6 files changed (+38 additions, -13 deletions)
View changed files
📝
.gitignore(+2 -0)📝
backend/pkg/server/auth/auth_middleware.go(+9 -0)📝
backend/pkg/server/services/auth.go(+12 -1)📝
backend/pkg/server/services/roles.go(+2 -2)📝
backend/pkg/server/services/users.go(+7 -7)📝
backend/pkg/tools/browser.go(+6 -3)📄 Description
PR Summary: 🔒 Security Hardening and Critical Bug Fixes
Overview
This PR addresses several security vulnerabilities and critical bugs identified in the authentication service, session management, and external tool integrations. The fixes range from preventing DoS attacks to correcting broken access control logic (ACL).
Key Changes
🛡️ Security Fixes
stateJSONbefore attempting to slice the signature. This prevents a runtime panic when processing malformed or intentionally short input.stateparameter against the stored session cookie, closing a CSRF gap in the GET handler.SameSite=Laxfor all session and callback cookies to mitigate CSRF risks.PasswordChangeRequiredset totrue, ensuring the policy is enforced before any session is granted.🛠️ Critical Bug Fixes
"users.view'"→"users.view"). These typos previously caused all permission checks to fail silently.expclaim. Sessions are now correctly invalidated as soon as they expire, even outside the/inforoute.Impact
Checklist
SameSiteattribute.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.