feat(investigations): Add response serializers - #121576
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 22b59ea. Configure here.
| "position": obj.position, | ||
| "kind": obj.kind, | ||
| "title": obj.title, | ||
| "content": content, | ||
| "generationPrompt": obj.prompt, | ||
| "generatedContent": generated_content, | ||
| "output": output, | ||
| "outputStatus": output_status, | ||
| "currentExecution": ( | ||
| { | ||
| "id": str(execution.id), | ||
| "status": execution.status, | ||
| "executor": execution.executor, | ||
| "schemaVersion": execution.result_schema_version, | ||
| "startedAt": execution.started_at, | ||
| "completedAt": execution.completed_at, | ||
| "error": execution.error, |
There was a problem hiding this comment.
Execution error field bypasses project access control in block serializer
currentExecution.error is serialized even when is_accessible returns False, potentially exposing stack traces or SQL fragments from restricted project executions.
Evidence
InvestigationBlockExecution.erroris aJSONField(null=True)onblock_execution.py:68with no schema constraint, so it may hold stack traces, SQL fragments, or internal paths from Seer runs.is_accessible(execution)(block.py:114-118) gates theoutputandcontentfields based onaccessible_project_ids, butcurrentExecutionis built unconditionally whenexecution is not None.- The
errorkey insidecurrentExecutionis included on line 173 without any accessibility check, so a viewer blocked from seeing a block's result can still receive the execution's error payload.
Also found at 1 additional location
src/sentry/investigations/endpoints/serializers/investigation.py:148
Identified by Warden · wrdn-data-exfil, security-review · H6E-FH6
This splits out the response serializers from #121403 to keep the total pr size down, and restructures them into separate folders.
0757dc0 to
1f11584
Compare
arslnb
left a comment
There was a problem hiding this comment.
Looks good, the warden comment shouldn't matter since this response (or error) is already visible to the user via the explorer flow

This splits out the response serializers from #121403 to keep the total pr size down, and restructures them into separate folders.