Skip to content

chore(deps): bump enshrined/svg-sanitize to 1.0 - #14285

Merged
HarshMN2345 merged 1 commit into
mainfrom
chore/svg-sanitize-1.0
Oct 9, 2026
Merged

HarshMN2345 merged 1 commit into
mainfrom
chore/svg-sanitize-1.0

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What does this PR do?

Bumps enshrined/svg-sanitize from 0.22.* to 1.0.*.

Three advisories published on 2026-10-08 cover <= 0.22.0: GHSA-9rjx-3jch-6vjf, GHSA-m9xh-6747-9r6f, GHSA-v383-3rw5-q8rf. Downstream builds that require appwrite/server-ce cannot move past the 0.22.* pin, so their composer audit fails until this lands.

The library is used once, in Avatars/Http/Favicon/Get.php, to clean SVG favicons fetched from arbitrary sites. 1.0.0 is a semver-only major: same Sanitizer, minify() and sanitize() API, plus the href cleaning fixes (case-sensitive href, href alongside xlink:href). The lock diff is this package only.

Test Plan

  • composer update enshrined/svg-sanitize -W changes only this package; composer audit reports no advisories.
  • Ran 1.0.0 through the endpoint's exact calls (minify(true), sanitize()):
    • A plain favicon SVG comes back minified and intact.
    • <script>, onload and javascript: hrefs (including HREF) are stripped; a safe xlink:href is kept.
    • Non-SVG input returns false, which the endpoint maps to AVATAR_SVG_SANITIZATION_FAILED.
  • Avatars E2E in CI.

Related PRs and Issues

  • Unblocks composer audit in appwrite-labs/cloud (appwrite-labs/cloud#6412 and main).

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

0.22.0 and earlier are covered by GHSA-9rjx-3jch-6vjf, GHSA-m9xh-6747-9r6f
and GHSA-v383-3rw5-q8rf, which fail `composer audit` downstream. 1.0.0 is
a semver-only major with the same Sanitizer API, and carries the href
cleaning fixes.
@luxor-code-review

luxor-code-review Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR is a single dependency bump of enshrined/svg-sanitize to 1.0, a semver-only major with the same Sanitizer API, closing three security advisories flagged by downstream composer audit. The sole sanitizer call site (src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php) remains API-compatible, and composer.lock is pinned to 1.0.0, consistent with the new constraint.

Files Change
composer.json Raises the enshrined/svg-sanitize constraint to ^1.0.0, addressing the three SVG-sanitizer security advisories.

Reviewed commit: f27659d

@ghost

ghost commented Oct 9, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The lockfile resolves the requested package version, and the existing sanitizer call remains compatible with the reported API.

Updates the enshrined/svg-sanitize Composer constraint and lock entry from 0.22.0 to 1.0.0. The dependency is used to minify and sanitize SVG favicons in the favicon endpoint.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
composer.json Pins enshrined/svg-sanitize to the 1.0.x release line.
composer.lock Locks the dependency to version 1.0.0.

Reviewed f27659d · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

32 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (17)
  • php.appwrite.permissive-write-permission (8)
  • php.appwrite.secret-compare-timing (5)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@HarshMN2345
HarshMN2345 merged commit 099ed06 into main Oct 9, 2026
62 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → chore/svg-sanitize-1.0 (after).

Metric Before After Change
🚀 Requests/sec 208.36 218.01 ⚪ +4.6%
⏱️ Latency P50 82.06 ms 79.45 ms ⚪ -3.2%
⏱️ Latency P95 191.51 ms 187.94 ms ⚪ -1.9%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 79.45 187.94 13,680 218.01 -3.57
Account 155.96 299.34 720 12.22 -1.44
TablesDB 75.18 134.81 7,440 121.67 -19.58
Storage 76.67 165.9 3,600 60.48 +5.4
Functions 117.69 242.5 1,920 33 +26.67

Top API waits (after)

API request Max wait (ms)
account.name.update 437.15
functions.variables.update 422.12
account.prefs.update 396.63
functions.delete 390.94
functions.create 375.5

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