GithubHelp home page GithubHelp logo

Comments (5)

eduardoboucas avatar eduardoboucas commented on May 10, 2024

Since all form requests will be cross-origin, wouldn't it be enough to check that the Origin header matches a value defined in the config?

from staticman.

envygeeks avatar envygeeks commented on May 10, 2024

For browsers sure, but it's easy to spoof anything with cURL, Ruby or any scripted language (including JavaScript on metal.) and send whatever data you need send. If moderation were enabled it makes it easier to catch these issues but without it, it becomes a problem.

from staticman.

envygeeks avatar envygeeks commented on May 10, 2024

I guess what I am saying is, I can send whatever origin pleases me if it's not in a browser and even then I might still be able to with a few patches if I really really wanted to (but that's not worth it.) But sending random spam with cURL is easy with origin.

from staticman.

eduardoboucas avatar eduardoboucas commented on May 10, 2024

I'm with you, that makes sense.

I know the basics of using a token for CSRF protection, but I confess I'll have to think/investigate a bit to come up with an implementation for this specific case.

The token is usually generated and appended to the page server-side, which of course we can't do here. This is why you mentioned an iframe, if I understand correctly. Would you load the form from a non-static source, so that it can generate a token? And wouldn't this source have to be the Staticman API, or not necessarily?

(On a side note, I guess still adding a check for Origin wouldn't hurt?)

from staticman.

eduardoboucas avatar eduardoboucas commented on May 10, 2024

Closing due to inactivity. If you're able to provide any more info and assist with direction, please reopen.

from staticman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.