Skip to content

Fix CWE-639 Insecure Direct Object Reference in Session Management#11

Open
kolega-dev-github-app[bot] wants to merge 1 commit into
mainfrom
kolega/fix-6d21fe80
Open

Fix CWE-639 Insecure Direct Object Reference in Session Management#11
kolega-dev-github-app[bot] wants to merge 1 commit into
mainfrom
kolega/fix-6d21fe80

Conversation

@kolega-dev-github-app

Copy link
Copy Markdown

Summary

This PR fixes a critical CWE-639 Insecure Direct Object Reference (IDOR) vulnerability in session management that allowed authenticated users to access other users' sessions by manipulating the x-openclaw-session-key header.

Changes

  • Created a new session-authorization.ts module to handle session key parsing, user identity extraction, and strict enforcement of session ownership rules
  • Implemented a core authorizeSessionAccess() function that prevents the IDOR attack by validating session ownership before granting access
  • Added support for different session key types (user-scoped, OpenAI-style, generic, legacy) with configurable authorization policies

Testing

The changes can be tested by running the existing test suite and verifying that the IDOR vulnerability has been addressed. Manual testing of session access control can also be performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants