Skip to content

Narrow upload types and keep request attachments private - #744

Merged
justinaskav merged 1 commit into
fix/url-schemesfrom
fix/uploads
Nov 6, 2026
Merged

justinaskav merged 1 commit into
fix/url-schemesfrom
fix/uploads

Conversation

@justinaskav

Copy link
Copy Markdown
Member

Uploads, support request attachments and file usage details.

  • File manager uploads no longer accept HTML, JS, CSS, XML or SVG; other upload requests check extensions alongside MIME types.
  • public/.htaccess (and the local nginx template) send nosniff on /uploads/ and a sandbox policy for HTML/SVG/XML files there.
  • Support request screenshots are stored on a private disk and served through supportRequests.evidence, authorised against the request.
  • File usage scan returns details only for records the user can view, and a count for the rest.

Who made what: Codex wrote the change and tests; Claude reviewed it, sent back broken test fixtures, and ran the tests.

Check by hand: uploading a PDF/PNG still works and an SVG is refused with a clear message; support request screenshots load for the submitter and handlers; the file usage list with hidden references.

Deploy:

  1. Verify the /uploads headers on production. FastPanel's nginx may serve static files without reaching .htaccess; PDFs and images must not get the sandbox header.
  2. Move existing screenshots: php artisan media:privatize-evidence --sync, then check --status. Public copies remain until --cleanup is run deliberately (it lists the files and asks first).

🤖 Generated with Claude Code

@justinaskav
justinaskav added this pull request to stack #747 November 6, 2026 20:35
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.11215% with 34 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/Console/Commands/PrivatizeSupportEvidence.php 65.21% 16 Missing ⚠️
app/Services/FileUsageScanner.php 80.48% 8 Missing ⚠️
app/Jobs/Media/PrivatizeSupportEvidence.php 0.00% 5 Missing ⚠️
app/Services/Media/SupportEvidenceTransfer.php 94.59% 4 Missing ⚠️
app/Http/Requests/Concerns/HasImageValidation.php 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 647 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
vusa-frontend-esm 7.84MB 647 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: vusa-frontend-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/php_admin_lt-*.js 106 bytes 343.03kB 0.03%
assets/php_admin_en-*.js 117 bytes 321.87kB 0.04%
assets/app-*.js 268 bytes 235.24kB 0.11%
assets/FileManager-*.js 156 bytes 108.59kB 0.14%

Files in assets/FileManager-*.js:

  • ./resources/js/Features/Admin/FileManager/Components/FileUsageList.vue → Total Size: 159 bytes

  • ./resources/js/Features/Admin/FileManager/useFileUsageScan.ts → Total Size: 1.41kB

@justinaskav
justinaskav removed this pull request from stack #747 November 6, 2026 20:46
@justinaskav
justinaskav added this pull request to stack #748 November 6, 2026 20:47
@justinaskav
justinaskav merged commit 0446af0 into dev Nov 6, 2026
30 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.

1 participant