Skip to content

Fix JSON injection vulnerability in delete_task() and related functions#19

Merged
VincentGuyader merged 1 commit intov4from
copilot/sub-pr-13-please-work
Feb 9, 2026
Merged

Fix JSON injection vulnerability in delete_task() and related functions#19
VincentGuyader merged 1 commit intov4from
copilot/sub-pr-13-please-work

Conversation

Copy link

Copilot AI commented Feb 9, 2026

The delete_task() function interpolated task_id directly into JSON strings without escaping, allowing malformed JSON when inputs contain quotes, backslashes, or other special characters.

Changes

  • R/tasks.R: Applied escape_json() to user-controlled values in Sync API commands:
    • delete_task(): escape task_id
    • close_task(): escape task_id
    • reopen_task(): escape task_id
    • update_task(): escape task_id, due_date, and labels array values

Example

# Before (vulnerable to injection):
commands = glue('[{{"type": "item_delete", "args": {{"id": "{task_id}"}}}}]')

# After (sanitized):
commands = glue('[{{"type": "item_delete", "args": {{"id": "{escape_json(task_id)}"}}}}]')

Applied in commits 040e023 and bf41593.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update test coverage and CI based on feedback from PR #13 Fix JSON injection vulnerability in delete_task() and related functions Feb 9, 2026
Copilot AI requested a review from VincentGuyader February 9, 2026 13:34
@VincentGuyader VincentGuyader marked this pull request as ready for review February 9, 2026 16:59
@VincentGuyader VincentGuyader merged commit 86cdec7 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