Hello there!

I’m also @savvywolf@furry.engineer , and I have a website at https://www.savagewolf.org/ .

He/They

  • 1 Post
  • 379 Comments
Joined 2 years ago
cake
Cake day: June 27th, 2023

help-circle
  • Had a quick skim and found this little guy:

    # ---------- Protected media route ----------
    @app.route('/img/<path:name>')
    @login_required
    def media(name):
        db = SessionLocal()
        try:
            me = current_user(db)
            # Find the post with this image
            post = db.query(Post).filter_by(image_path=name).first()
            if post:
                # Check visibility
                can_view = post.user_id == me.id or db.query(UserVisibility).filter_by(
                    owner_id=post.user_id, viewer_id=me.id
                ).first() is not None
                if not can_view:
                    abort(403)
            return send_from_directory(UPLOAD_DIR, os.path.basename(name))
        finally:
            db.close()
    

    I’ve not read through everything, but there are some security concerns that jump out to me from just this function. Hopefully you can enlighten me on them.

    Firstly, what is stopping a logged in user from accessing any image that, for whatever reason, doesn’t have an associated post for it?

    Secondly, the return codes for “the image doesn’t exist” (404) and “the image exists but you can’t access it” (403) look to be different. This means that a logged in user can check whether a given filename (e.g. “epstien_and_trump_cuddling.jpg”) has been uploaded or not by any user.

    Both of these look to be pretty bad security issues, especially for a project touting its ability to protect from nationstates. Am I missing something?





  • For the swap space, yes that’s for when you run out of RAM. 48GiB is plenty of RAM, so you should be fine without it. I have 32GiB of RAM on my system and have been running without swap for ages without issue.

    Hardening guides like that are mostly designed for things like web servers which are connected to the public internet and need higher scrutiny. The default configuration for distros like Mint should be secure enough for the average user.

    However, don’t feel invincible and run random code from random sites. Both Windows and Linux can’t protect you against malicious code you run yourself.

    Having organised partitions is the kind of thing that people obsessed with organisation do. For most people, the default partitioning scheme is fine. However, as always, remember to keep backups of important data.

    For installing software, Mint has a Software Centre (which is distinct from the Snap Store). I’d recommend installing software using that for the average user.

    In Mint, there are three main types of packages:

    • Debian/APT packages, which are provided by Mint (well, technically by the Debian distro and they trickle down to Mint, but technicalities). Not all software is available from Mint’s repos and they may be out of date.
    • Flatpak packages, which are provided either by developers themselves or dedicated fans. They are usually more up to date and have a degree of sandboxing.
    • Snap packages, which are controlled by a company named Canonical. As of late, Canonical has been a bit “ehhhh”, so there’s pushback against Snap. Mint has it disabled and has their reasoning explained here: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html

    Mint’s software centre is able to install both Debian and Flatpak packages. I’d recommend using it where possible since it allows automatic upgrades and easier installation/uninstallation.





  • Dual booting is fine. Bitlocker just makes it so that the installer isn’t able to resize the Windows partition (since it’s encrypted), but you can resize it in Windows to create enough space to put Mint on. You can also disable bitlocker entirely, but your files will no longer be encrypted.

    There’s worry about the bootloader being nuked, but I think that’s a bit of an overreaction. Now everything is EFI, Windows shouldn’t touch other OSes. If it does, then that doesn’t require a full reinstall; it’s possible to boot from the live USB (the installer) and reinstall just the bootloader.