mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #1291] Unauthorised users can create topics #913
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#913
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @baldrich25 on GitHub (Mar 13, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1291
🐞 Describe the bug
Unauthorised users can send a request to create a topic, the user is provided a 40301, however the topic is still created.
💻 Components impacted
ntfy server
💡 Screenshots and/or logs
🔮 Additional context
Using the builtin metrics server, you can monitor the count of topics on the server at a given time.
When sending unauthorised requests to publish to a topic, the user is provided a 4031 however the metric count still goes up, suggesting the topic is actually create on the server, the user just had no rights to join the topic.
@binwiederhier commented on GitHub (Aug 11, 2025):
I suppose that this is technically correct (the best kind of correct), but it's effectively just semantics. Topics are ephemeral and are held in memory in a map (https://github.com/binwiederhier/ntfy/blob/main/server/server.go#L53), and topics are removed regularly if nobody accesses them: https://github.com/binwiederhier/ntfy/blob/main/server/server_manager.go#L38-L52.
So yes, when somebody tries to access a topic, it is created in memory, but since nobody can publish to it, it'll eventually be removed.
While technically correct, it's not worth fixing