Skip to content

fix(api): include create secrets when resolving tags in bulk upsert#5324

Merged
scott-ray-wilson merged 3 commits intoInfisical:mainfrom
MuzzaiyyanHussain:fix/api-bulk-update
Feb 5, 2026
Merged

fix(api): include create secrets when resolving tags in bulk upsert#5324
scott-ray-wilson merged 3 commits intoInfisical:mainfrom
MuzzaiyyanHussain:fix/api-bulk-update

Conversation

@MuzzaiyyanHussain
Copy link
Contributor

Fixes a crash in bulk upsert by resolving tags for both created and updated secrets before permission checks.
fixes #5268

@maidul98
Copy link
Collaborator

maidul98 commented Jan 30, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Fixed a crash in the bulk upsert operation that occurred when creating new secrets with tags. The bug happened because tag resolution only included secrets being updated (secretsToUpdate) but excluded secrets being created (secretsToCreate). When the permission check later tried to resolve tag slugs for created secrets at line 2056, it would crash trying to access tagsGroupByID[i][0] for tag IDs that weren't fetched.

The fix includes both secretsToUpdate and secretsToCreate when collecting tag IDs for resolution, ensuring all referenced tags are validated and available before permission checks.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix correctly addresses a clear bug where tag IDs from created secrets weren't being fetched before permission validation, causing crashes. The change is minimal, focused, and follows the existing code patterns. No security issues, breaking changes, or edge cases identified.
  • No files require special attention

Important Files Changed

Filename Overview
backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts Fixed crash in bulk upsert by including created secrets when resolving tags for permission checks

@MuzzaiyyanHussain
Copy link
Contributor Author

@varonix0

@MuzzaiyyanHussain
Copy link
Contributor Author

@scott-ray-wilson @varonix0 are you planning to merge this ?

@scott-ray-wilson scott-ray-wilson self-requested a review February 4, 2026 17:54
Copy link
Contributor

@scott-ray-wilson scott-ray-wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed resolves bug, please address lint issue

@MuzzaiyyanHussain
Copy link
Contributor Author

can you please check again, fixed the linting issue.

Copy link
Contributor

@scott-ray-wilson scott-ray-wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has a lint issue, you should be able to run npm run lint:fix in the backend to address this

@MuzzaiyyanHussain
Copy link
Contributor Author

Fixed

@scott-ray-wilson scott-ray-wilson self-requested a review February 5, 2026 23:12
Copy link
Contributor

@scott-ray-wilson scott-ray-wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing!

@scott-ray-wilson scott-ray-wilson merged commit 0b1895f into Infisical:main Feb 5, 2026
8 of 9 checks 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.

Infisical API bulk update fails with internal server error (500)

3 participants