Skip to content

Fix JSON injection vulnerabilities in invitation and collaborator functions#18

Merged
VincentGuyader merged 1 commit intov4from
copilot/sub-pr-13-one-more-time
Feb 9, 2026
Merged

Fix JSON injection vulnerabilities in invitation and collaborator functions#18
VincentGuyader merged 1 commit intov4from
copilot/sub-pr-13-one-more-time

Conversation

Copy link

Copilot AI commented Feb 9, 2026

The accept_invitation(), reject_invitation(), delete_invitation(), and delete_collaborator() functions were vulnerable to JSON injection by directly interpolating user-controlled parameters into JSON command strings.

Changes

  • Applied escape_json() to all user-controlled parameters in invitation/collaborator functions:
    • accept_invitation(): escaped invitation_id and invitation_secret
    • reject_invitation(): escaped invitation_id and invitation_secret
    • delete_invitation(): escaped invitation_id
    • delete_collaborator(): escaped project_id and email

Example

Before:

commands = glue('[{{"type": "accept_invitation", "uuid": "{random_key()}", "args": {{"invitation_id": "{invitation_id}", "invitation_secret": "{invitation_secret}"}}}}]')

After:

commands = glue('[{{"type": "accept_invitation", "uuid": "{random_key()}", "args": {{"invitation_id": "{escape_json(invitation_id)}", "invitation_secret": "{escape_json(invitation_secret)}"}}}}]')

The escape_json() function handles backslashes, quotes, newlines, carriage returns, and tabs to prevent malformed JSON payloads.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Address feedback on test coverage and CI updates in v0.4.0 Fix JSON injection vulnerabilities in invitation and collaborator functions Feb 9, 2026
Copilot AI requested a review from VincentGuyader February 9, 2026 13:33
@VincentGuyader VincentGuyader marked this pull request as ready for review February 9, 2026 16:59
@VincentGuyader VincentGuyader merged commit 88c871a into v4 Feb 9, 2026
1 check passed
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.

2 participants