

to the extent Tor is secure
Tor doesn’t automatically secure your app. If your social media instance has 1000 users on it, and one user gets compromised, then the other 999 users shouldn’t have any interactions outside of that user leaked.
web crypto can be utilized for group and 1-1s for an additional layer of encryption
Are file uploads encrypted?
How would you ever discover a filename?
Maybe you have a data leak. Maybe they send the filename in plaintext somewhere. Maybe they take advantage of the fact that UUIDs might be deterministic. But if I may flip the question… Why does an inaccessible post even need to return 403 anyway? It just functions as a big footgun that may cause any other exploits to behave worse.
Even if you have the correct link, if those two conditions arnt satisfied you will not be able to view.
But you can determine its existence or not through the status code.
This was a design choice to have consistency in filetypes. What’s the downside? All browsers will support displaying a jpg.
Gifs will lose any animation, pngs will lose quality. Also, as far as I can tell, there’s nothing stopping a malicious user uploading a non-image file.
Which part are you talking about?
There are two steps to making a post: Upload and store the image and add the post to the database. There’s also similar steps to deleting a post: Removing the image upload and removing the post from the database. Are both these operations atomic?
Everything except the login page, registration link will behind these two checks see (def login) where the @loginrequired logic is defined for each of the app routes.
It’s not that hard for a sufficiently motivated adversary to get an account on a sufficiently large instance. You need to ensure that one user account being compromised doesn’t result in information leakage from unrelated accounts.
This discussion stems from issues I found in just one function. You’re making a product which requires a very high level of security. You need to understand how to write secure code, and your LLM won’t be able to do it for you.
I don’t want to discourage you from programming in general, but making a very secure social media site is a rather complex undertaking for someone new to programming.









Two factor authentication won’t help here. You have to build your app with the assumption that any attacker has a valid login and credentials and therefore restrict them to only information they have permission to see.
Usually when people talk about e2e encrypted messaging they mean that everything is encrypted. That includes images and text content. The server should not be able to read any contents of any message sent through it.
Why? Sending memes is a core part of any social media experience.
Line 350 in both files doesn’t seem to contain any filetype checks. I assume you mean
file.content_type. That may not be accurate to the actual file uploaded; it can be spoofed.# Delete the associated message if it exists if chat_file.message_id: msg = db.get(Message, chat_file.message_id) if msg: db.delete(msg) ---> Here # Delete file from disk file_path = os.path.join(CHAT_FILES_DIR, file_uuid) if os.path.exists(file_path): os.remove(file_path)If the application crashes/closes at the indicated point, then you will delete the message from the database but still have the image on the server. If this is an image served from
/img/whatever, it would have no checks beyond a login check.