Skip to content

Fix sprintf vulnerability - #4856

Merged
ildyria merged 2 commits into
masterfrom
sprintf
Oct 8, 2026
Merged

ildyria merged 2 commits into
masterfrom
sprintf

Conversation

@ildyria

@ildyria ildyria commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added built-in string formatting for messages and labels, with support for positional and named placeholders.
  • Chores
    • Updated dependency ranges and excluded a vulnerability with no available fix.
    • Updated the frontend architecture reference to describe the built-in formatter.

@ildyria
ildyria requested a review from a team as a code owner October 8, 2026 11:23
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 822acd2c-d64f-416c-843c-dbf93ca4d4e6
📥 Commits

Reviewing files that changed from the base of the PR and between 9a1477f and ca28aab.

📒 Files selected for processing (1)
  • resources/js/utils/sprintf.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/js/utils/sprintf.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The frontend adds a local sprintf and vsprintf utility, redirects v7 and v8 consumers to it, and removes sprintf-js from package dependencies. The pull request also updates dependency ranges, adds an ignored vulnerability entry, edits a Persian translation string, and updates the architecture reference.

Changes

Local sprintf Formatter

Layer / File(s) Summary
Formatter implementation and package updates
resources/js/utils/sprintf.ts, package.json, docs/specs/3-reference/frontend-architecture.md
Adds sprintf and vsprintf with format parsing, conversions, padding, and a bounded cache. Removes sprintf-js and its types from package dependencies, updates other dependency ranges, and documents the local utility as compatible with sprintf-js.
v7 formatter imports
resources/js/composables/album/*, resources/js/v7/components/*, resources/js/v7/views/*
v7 consumers import sprintf from the local utility. Existing formatting call sites remain unchanged.
v8 formatter imports
resources/js/v8/composables/album/*, resources/js/v8/components/*, resources/js/v8/views/*
v8 consumers import sprintf from the local utility. Existing formatting call sites remain unchanged.

Vulnerability Exclusion

Layer / File(s) Summary
Ignored vulnerability entry
osv-scanner.toml
Adds GHSA-rj75-hqrm-r3gf to the ignored vulnerabilities with the reason “No solution yet.”

Persian Translation Placeholder

Layer / File(s) Summary
Merge confirmation placeholders
lang/fa/tags.php
Removes backslashes before the two format placeholders in merge_confirm. The message text and placeholder order remain unchanged.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🔵 Low · up to ca28a

The dependency finding remains suppressed because its parent pins the affected version. The PR is mergeable with owner awareness and a plan to revisit the ignore when that constraint can be updated.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit formats words with care
Percent signs hop through the air
Old imports take a local track
New ranges join the stack
The burrow hums with strings repaired

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4ea639b3-fe52-4dd6-90b0-84a77364ca93
📥 Commits

Reviewing files that changed from the base of the PR and between 739f157 and 9a1477f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (107)
  • docs/specs/3-reference/frontend-architecture.md
  • lang/fa/tags.php
  • osv-scanner.toml
  • package.json
  • resources/js/composables/album/buyMeActions.ts
  • resources/js/composables/album/treeOperations.ts
  • resources/js/utils/sprintf.ts
  • resources/js/v7/components/drawers/LiveMetrics.vue
  • resources/js/v7/components/drawers/PhotoEdit.vue
  • resources/js/v7/components/forms/album/AlbumDelete.vue
  • resources/js/v7/components/forms/album/AlbumMove.vue
  • resources/js/v7/components/forms/album/AlbumTransfer.vue
  • resources/js/v7/components/forms/album/ApplyRenamerDialog.vue
  • resources/js/v7/components/forms/album/EmbedCodeDialog.vue
  • resources/js/v7/components/forms/auth/LoginForm.vue
  • resources/js/v7/components/forms/gallery-dialogs/AlbumMergeDialog.vue
  • resources/js/v7/components/forms/gallery-dialogs/DeleteDialog.vue
  • resources/js/v7/components/forms/gallery-dialogs/MoveDialog.vue
  • resources/js/v7/components/forms/people/PersonDeleteDialog.vue
  • resources/js/v7/components/forms/photo/PhotoCopyDialog.vue
  • resources/js/v7/components/forms/photo/PhotoLicenseDialog.vue
  • resources/js/v7/components/forms/photo/PhotoTagDialog.vue
  • resources/js/v7/components/forms/profile/SetOauth.vue
  • resources/js/v7/components/forms/search/SearchInputBar.vue
  • resources/js/v7/components/forms/tags/TagDeleteDialog.vue
  • resources/js/v7/components/forms/tags/TagMergeDialog.vue
  • resources/js/v7/components/gallery/flowModule/AlbumCard.vue
  • resources/js/v7/components/gallery/searchModule/ResultPanel.vue
  • resources/js/v7/components/maintenance/MaintenanceBackfillAlbumSizes.vue
  • resources/js/v7/components/maintenance/MaintenanceBulkScanFaces.vue
  • resources/js/v7/components/maintenance/MaintenanceCleaning.vue
  • resources/js/v7/components/maintenance/MaintenanceDestroyDismissedFaces.vue
  • resources/js/v7/components/maintenance/MaintenanceFilesize.vue
  • resources/js/v7/components/maintenance/MaintenanceFixJobs.vue
  • resources/js/v7/components/maintenance/MaintenanceFlushQueue.vue
  • resources/js/v7/components/maintenance/MaintenanceFulfillOrders.vue
  • resources/js/v7/components/maintenance/MaintenanceFulfillPrecompute.vue
  • resources/js/v7/components/maintenance/MaintenanceGenSizevariants.vue
  • resources/js/v7/components/maintenance/MaintenanceMissingPalettes.vue
  • resources/js/v7/components/maintenance/MaintenanceOldOrders.vue
  • resources/js/v7/components/maintenance/MaintenancePurgeOrphanFaceEmbeddings.vue
  • resources/js/v7/components/maintenance/MaintenanceResetFaceScanStatus.vue
  • resources/js/v7/components/maintenance/MaintenanceSyncFaceEmbeddings.vue
  • resources/js/v7/components/maintenance/StatisticsIntegrity.vue
  • resources/js/v7/components/modals/InviteUser.vue
  • resources/js/v7/components/pagination/PaginationLoadMore.vue
  • resources/js/v7/components/statistics/Activity.vue
  • resources/js/v7/components/statistics/PunchCard.vue
  • resources/js/v7/components/webshop/InfoSection.vue
  • resources/js/v7/components/webshop/PaymentForm.vue
  • resources/js/v7/views/FixTree.vue
  • resources/js/v7/views/admin/UserGroups.vue
  • resources/js/v7/views/webshop/OrderDownload.vue
  • resources/js/v7/views/webshop/OrderList.vue
  • resources/js/v8/components/drawers/LiveMetrics.vue
  • resources/js/v8/components/drawers/PhotoEdit.vue
  • resources/js/v8/components/forms/album/AlbumDelete.vue
  • resources/js/v8/components/forms/album/AlbumMove.vue
  • resources/js/v8/components/forms/album/AlbumTransfer.vue
  • resources/js/v8/components/forms/album/ApplyRenamerDialog.vue
  • resources/js/v8/components/forms/album/EmbedCodeDialog.vue
  • resources/js/v8/components/forms/auth/LoginForm.vue
  • resources/js/v8/components/forms/gallery-dialogs/AlbumMergeDialog.vue
  • resources/js/v8/components/forms/gallery-dialogs/DeleteDialog.vue
  • resources/js/v8/components/forms/gallery-dialogs/MoveDialog.vue
  • resources/js/v8/components/forms/people/PersonDeleteDialog.vue
  • resources/js/v8/components/forms/photo/PhotoCopyDialog.vue
  • resources/js/v8/components/forms/photo/PhotoLicenseDialog.vue
  • resources/js/v8/components/forms/photo/PhotoTagDialog.vue
  • resources/js/v8/components/forms/profile/SetOauth.vue
  • resources/js/v8/components/forms/search/SearchInputBar.vue
  • resources/js/v8/components/forms/tags/TagDeleteDialog.vue
  • resources/js/v8/components/forms/tags/TagMergeDialog.vue
  • resources/js/v8/components/gallery/flowModule/AlbumCard.vue
  • resources/js/v8/components/gallery/flowModule/AlbumCardV3.vue
  • resources/js/v8/components/gallery/searchModule/ResultPanel.vue
  • resources/js/v8/components/insights/CalendarSection.vue
  • resources/js/v8/components/insights/ExposureSection.vue
  • resources/js/v8/components/insights/FocalSection.vue
  • resources/js/v8/components/insights/FormatsSection.vue
  • resources/js/v8/components/insights/PlacesSection.vue
  • resources/js/v8/components/insights/TimeSpanSection.vue
  • resources/js/v8/components/maintenance/MaintenanceBackfillAlbumSizes.vue
  • resources/js/v8/components/maintenance/MaintenanceBulkScanFaces.vue
  • resources/js/v8/components/maintenance/MaintenanceCleaning.vue
  • resources/js/v8/components/maintenance/MaintenanceDestroyDismissedFaces.vue
  • resources/js/v8/components/maintenance/MaintenanceFilesize.vue
  • resources/js/v8/components/maintenance/MaintenanceFixJobs.vue
  • resources/js/v8/components/maintenance/MaintenanceFlushQueue.vue
  • resources/js/v8/components/maintenance/MaintenanceFulfillOrders.vue
  • resources/js/v8/components/maintenance/MaintenanceFulfillPrecompute.vue
  • resources/js/v8/components/maintenance/MaintenanceGenSizevariants.vue
  • resources/js/v8/components/maintenance/MaintenanceMissingPalettes.vue
  • resources/js/v8/components/maintenance/MaintenanceOldOrders.vue
  • resources/js/v8/components/maintenance/MaintenancePurgeOrphanFaceEmbeddings.vue
  • resources/js/v8/components/maintenance/MaintenanceResetFaceScanStatus.vue
  • resources/js/v8/components/maintenance/MaintenanceSyncFaceEmbeddings.vue
  • resources/js/v8/components/maintenance/StatisticsIntegrity.vue
  • resources/js/v8/components/modals/InviteUser.vue
  • resources/js/v8/components/pagination/PaginationLoadMore.vue
  • resources/js/v8/components/webshop/InfoSection.vue
  • resources/js/v8/components/webshop/PaymentForm.vue
  • resources/js/v8/composables/album/treeOperations.ts
  • resources/js/v8/views/FixTree.vue
  • resources/js/v8/views/admin/UserGroups.vue
  • resources/js/v8/views/webshop/OrderDownload.vue
  • resources/js/v8/views/webshop/OrderList.vue

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread osv-scanner.toml
Comment thread resources/js/utils/sprintf.ts Outdated
@ildyria
ildyria merged commit 5e13568 into master Oct 8, 2026
28 checks passed
@ildyria
ildyria deleted the sprintf branch October 8, 2026 12:03
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.

1 participant