Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Content-Type header when fetching entities #388

Merged
merged 18 commits into from
Oct 28, 2023

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented Oct 25, 2023

This PR adds checks to verify that the server actually returned an valid ActivityPub content type.

We do this to prevent situations where someone would, for example, host actors on things like GitHub Gists where a malicious actor could appear to be hosted on gist.github.com, giving them some credibility.

@aumetra aumetra requested a review from tesaguri October 25, 2023 20:26
@aumetra aumetra force-pushed the aumetra/verify-content-type branch from 953eed8 to 65e489d Compare October 25, 2023 20:54
@aumetra aumetra marked this pull request as ready for review October 25, 2023 21:15
@aumetra
Copy link
Member Author

aumetra commented Oct 26, 2023

(@tesaguri just waiting for a small +1 if this is what you imagined)

Copy link
Contributor

@tesaguri tesaguri left a comment

Choose a reason for hiding this comment

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

A note on content sniffing and other minor nits. Looks good otherwise!

crates/kitsune-core/src/activitypub/fetcher.rs Outdated Show resolved Hide resolved
crates/kitsune-core/src/activitypub/fetcher.rs Outdated Show resolved Hide resolved
crates/kitsune-core/src/activitypub/fetcher.rs Outdated Show resolved Hide resolved
crates/kitsune-core/src/activitypub/fetcher.rs Outdated Show resolved Hide resolved
crates/kitsune-test/src/lib.rs Outdated Show resolved Hide resolved
@aumetra aumetra requested a review from tesaguri October 27, 2023 17:56
@tesaguri
Copy link
Contributor

tesaguri commented Oct 28, 2023

Added a minor question comment (#388 (comment)). Otherwise looks good!

@aumetra aumetra added this pull request to the merge queue Oct 28, 2023
Merged via the queue into main with commit 54e4d11 Oct 28, 2023
12 checks passed
@aumetra aumetra deleted the aumetra/verify-content-type branch October 28, 2023 14:58
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