Commit Graph

201 Commits (dev)

Author SHA1 Message Date
Daniel Supernault 56b96359c3
Fix fetching by properly retrying certain error responses 2 days ago
Daniel Supernault 0e0de62dd9
Fix ActivityPub url resolution 4 days ago
Daniel Supernault 81e71a04f8
Update Helpers::validateUrl(), skip validation for app domain/url optionally 4 days ago
Daniel Supernault 80f792038c
Fix federation comment threading 4 days ago
Daniel Supernault dedfa67b70
Add FEP-8fcf followers collection synchronization
Sender: followers-only Create deliveries carry a signed
Collection-Synchronization header scoped to the authority of each inbox,
and the partial followers collection is served to authenticated instances
at /users/{username}/followers_synchronization.

Receiver: a signed Collection-Synchronization header whose digest differs
from our copy queues FollowersSyncPipeline, which fetches the partial
collection as the instance actor and reconciles followers, pending follow
requests and unknown follows.

Adds profiles.followers_url for the collectionId check.
5 days ago
Daniel Supernault 8a741d998d
Update ActivityPub helpers, improve url resolution and reply handling 5 days ago
Daniel Supernault c7600fb51a
Update FeedInsertRemotePipeline, prevent statuses older than a week from being distributed 5 days ago
Your Name 53b698ec48 Revert "StrictArrayParamDimFetchRector"
This reverts commit a28d3df4c4.
6 days ago
Your Name 6beab304a0 lint 6 days ago
Your Name a28d3df4c4 StrictArrayParamDimFetchRector 6 days ago
Your Name a5d413a594 ExplicitReturnNullRector 6 days ago
Your Name 0435d08568 RemoveAlwaysElseRector 6 days ago
Your Name 5949dc21c1 UseIdenticalOverEqualWithSameTypeRector 6 days ago
Your Name 9fde74082a add type to function 6 days ago
Your Name c57e5d8ed7 adding type 6 days ago
Your Name 8dcdd93e2b RemoveUnusedVariableInCatchRector 6 days ago
Your Name f1d4c87391 const types 6 days ago
Daniel Supernault d1d35ece53
Fix ActivityPub helpers 6 days ago
Daniel Supernault fbd0922fd0
Update Helpers 1 week ago
Daniel Supernault fbd52dd8fc
Improve federation handling 2 weeks ago
Your Name 277b8aa970 Use now() helper instead of Carbon::now() for current-time access
Aligns with the app's dominant convention (413 now()/today() call
sites vs 12 Carbon::now()). Carbon::parse() calls are untouched since
they parse arbitrary date strings, not current-time access.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 weeks ago
Your Name 73fb5ed696 Fall back to stored profile when remote refresh fails 2 weeks ago
Your Name 1905da723d Validate publicKey.id host on inbox actor ingest to prevent key_id poisoning 2 weeks ago
Daniel Supernault c558724e47
Update AP Helpers 2 weeks ago
Daniel Supernault e57f7ccd3a
Update Helpers.php 2 weeks ago
Your Name 042ab0a6e4 Convert optional() to nullsafe operator
Applies patch 2/21 from pixelfed-staging PR #9: replaces optional($x)->y
with $x?->y across 16 files. Pint-clean.
3 weeks ago
Your Name 0df4c7117d Add domain-mismatch metadata to Announce status fetch and stop noisy ERROR logs
storeStatus() now throws with JSON metadata (checked id/url hosts, expected
rule, and the full activity payload) when status domains mismatch. The Announce
inbox handler catches this, logs the context at debug level, and returns
gracefully instead of surfacing a full production ERROR stack trace.
3 weeks ago
Your Name 87ed60d675 Accept compacted Note attachments (#6588)
Normalize JSON-LD compacted single attachments (a bare object instead of a
one-item array) in getAttachments(), and route verifyAttachments() through it
so validation and import share one normalization path.

Includes PR #6589's tests plus additional edge-case coverage: list-form
preservation, bare-input normalization, and guards for missing/empty/scalar
attachments.
4 weeks ago
Your Name 0d01d5a963 Fix duplicate-key violation when importing remote media attachments
Helpers::importNoteAttachment unconditionally inserted a new Media row per
attachment, so re-importing a remote status (an Announce racing another
inbox job, a re-fetch, or a duplicate url within one activity) hit the
media_status_id_media_path_unique constraint and crashed the queue job with
a 1062 UniqueConstraintViolationException, dropping the boost/import.

Make createMediaAttachment idempotent on (status_id, media_path): skip when
a row already exists, and catch the unique-constraint violation as a
lost-race no-op, returning null so the caller skips re-dispatching storage.

Adds regression tests (re-import no-op, distinct urls still stored,
concurrent-insert returns null).
4 weeks ago
Your Name 3d82a8e8b2 Fix unauthenticated SSRF in remote media/avatar fetch (variant of CVE-2026-71246)
The remote media path validated URLs only as strings (Helpers::validateUrl
normalizes the host + checks a ban list) and then downloaded them with
Http::head + file_get_contents($url), which resolve DNS themselves and
follow redirects with no private-IP checks and no address pinning. A remote
actor whose icon.url redirected to an internal address (e.g. 172.18.0.1 or
169.254.169.254) made the queue worker fetch internal content and, for
image responses, republish it at a public avatar URL. No account required.

Fixes:
- Add SecureMediaFetchService: validates URL, resolves + rejects non-global
  IPs (fail-closed), pins the connection to the validated IP via
  CURLOPT_RESOLVE, disables auto-redirects with per-hop re-validation, and
  enforces https-only + a byte cap. Mirrors the ActivityPubFetchService
  hardening from CVE-2026-71246.
- Route MediaStorageService head()/fetchAvatar()/remoteToCloud() through it,
  removing the bare Http::head and file_get_contents($url) sinks.
- validateUrl(): when DNS verification is enabled, reject hosts that resolve
  into reserved ranges, closing the metadata.google.internal bypass.
- Harden adjacent same-class sinks: CustomEmojiService (emoji doc + image +
  head), FetchCacheService/webfinger, and DiscoverActor.
- Add regression tests (tests/Unit/ActivityPub/SsrfUrlValidationTest.php).
4 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Daniel Supernault 30085e8708
Fix validateUrl() 4 weeks ago
Daniel Supernault bb33409fea
Lint 1 month ago
Daniel Supernault b84ae82f60
Update helpers 1 month ago
dansup 4748f66a02
Merge pull request #6687 from pixelfed/shleeable-patch-21
Improve validation
1 month ago
Daniel Supernault 2216402ed4
Update Helpers 1 month ago
Shlee 595220e088
Update Helpers.php 1 month ago
Shlee 886306d1d0
Update Helpers.php 1 month ago
dansup 40a5130430
Fix federation (#6346)
* Prepared new docker

* Docker setup improvements and fixes

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update .dockerignore

* DB/Redis health check

* updated health checks

* updated install guide

* updated DOCKER_SETUP

* Updated DOCKER_SETUP

* Updated DOCKER_SETUP

* Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md

* RemoveUnreachableStatementRector

* Update GroupActivityPubService.php

* Larastan: Add @property

* Delete rector.php

* more properties

* 2fa_enabled needs to be refactored

* Fix AdminUser.php syntax error - remove invalid property declaration

* Update AdminUser.php

* update

* Upgrade predis from v2.0 to v3.2

- Update predis/predis from ^2.0 to ^3.2
- Predis v3.2.0 includes RESP3 support, improved pipeline abstractions
- No code changes required, configuration remains compatible
- Tested successfully with tinker

* Upgrade predis from v2.0 to v3.2

* Update

* Update .env.docker.example

* Update DOCKER_COMPOSE_SETUP.md

* Create ImageDriverManager.php

* Update image.php

* Update ImageResizePipeline.php

* Update StoryComposeController.php

* Update AvatarOptimize.php

* Update Image.php

* Update composer.json

* Update AvatarOptimize.php

* update lock

* Update composer.lock

* update

* update

* update

* Allow to set new image types in admin interface

* Update composer, fix deps

* Update composer

* Update DOCKER_COMPOSE_SETUP.md - Added troubleshooting (#6344)

* Staging (#6343)

* Prepared new docker

* Docker setup improvements and fixes

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update DOCKER_SETUP.md

* Update .dockerignore

* DB/Redis health check

* updated health checks

* updated install guide

* updated DOCKER_SETUP

* Updated DOCKER_SETUP

* Updated DOCKER_SETUP

* Update and rename DOCKER_SETUP.md to DOCKER_COMPOSE_SETUP.md

* RemoveUnreachableStatementRector

* Update GroupActivityPubService.php

* Larastan: Add @property

* Delete rector.php

* more properties

* 2fa_enabled needs to be refactored

* Fix AdminUser.php syntax error - remove invalid property declaration

* Update AdminUser.php

* update

* Upgrade predis from v2.0 to v3.2

- Update predis/predis from ^2.0 to ^3.2
- Predis v3.2.0 includes RESP3 support, improved pipeline abstractions
- No code changes required, configuration remains compatible
- Tested successfully with tinker

* Upgrade predis from v2.0 to v3.2

* Update

* Update .env.docker.example

* Update DOCKER_COMPOSE_SETUP.md

* Create ImageDriverManager.php

* Update image.php

* Update ImageResizePipeline.php

* Update StoryComposeController.php

* Update AvatarOptimize.php

* Update Image.php

* Update composer.json

* Update AvatarOptimize.php

* update lock

* Update composer.lock

* update

* update

* update

* Allow to set new image types in admin interface

* Update composer, fix deps

* Update composer

---------

Co-authored-by: Shlee <github@shl.ee>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Severin <savewish@icloud.com>

* Update DOCKER_COMPOSE_SETUP.md

* Update DOCKER_COMPOSE_SETUP.md

---------

Co-authored-by: dansup <danielsupernault@gmail.com>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Severin <savewish@icloud.com>

* Regression - Fix federation - Update ActivityHandler.php (#6345)

* Update ActivityHandler.php

* Update ActivityHandler.php

* Revert inbox changes

* Fix InboxWorker

---------

Co-authored-by: Shlee <github@shl.ee>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Severin <savewish@icloud.com>
10 months ago
Daniel Supernault efd351900d
Fix InboxWorker 10 months ago
dansup 7881b09c2f
Merge pull request #6304 from pixelfed/classV2
Larastan: Fix Missing classes 2 - Medium risk
11 months ago
Your Name 15cc07e602 Fix all class.notFound PHPStan issues - 31 fixes 11 months ago
Your Name 72e840345e Fix PHPStan 'empty() always exists and is not falsy' errors
- Remove redundant empty() checks where variables are guaranteed to exist and be non-falsy
- Replace empty() with simple null/false checks where appropriate
- Maintain original logic while fixing static analysis issues
- Affected files:
  - app/Http/Controllers/GroupController.php
  - app/Http/Controllers/ProfileAliasController.php
  - app/Jobs/ImageOptimizePipeline/ImageUpdate.php
  - app/Jobs/InboxPipeline/DeleteWorker.php
  - app/Jobs/InboxPipeline/InboxValidator.php
  - app/Jobs/InboxPipeline/InboxWorker.php
  - app/Jobs/ProfilePipeline/HandleUpdateActivity.php
  - app/Rules/ExpoPushTokenRule.php
  - app/Services/AutospamService.php
  - app/Services/CollectionService.php
  - app/Services/NotificationAppGatewayService.php
  - app/Services/WebfingerService.php
  - app/Util/ActivityPub/Helpers.php
11 months ago
Daniel Supernault 3686c92122
Update Status storage, add SanitizerService to fix spacing in html stripped content 1 year ago
daniel 2b4bccdfb1
Merge pull request #5972 from intentionally-left-nil/fix-id-domain-mismatch
Fix id domain mismatch
1 year ago
Daniel Supernault cb80c65995
Fix tests 1 year ago
Anil Kulkarni e3b7f1d7cd
For an ActivityStream object, such as a note, the code currently validates
the domain of the object id, matches the domain of the object url.
However, the current implementation of threads has objects where the id is
threads.net/ap/... and the url is www.threads.com/...
The AS spec does not guarantee any particular relationship between the
id and url. The only requirement is that the id is globally unique.
Additionally, mastodon also does not appear to require the domains to
match
1 year ago
Daniel Supernault 75e7a678ce
Update ActivityPub helpers 2 years ago
Daniel Supernault 22eae69fd5
Update AP Helpers, fix comment bug 2 years ago