Giter VIP home page Giter VIP logo

Comments (5)

ericop avatar ericop commented on May 17, 2024 1

@JarLob thanks for the well explained response. I didn't know about the Error List ... indicating it was still analyzing, so that will be helpful going forward.

I'm personnally trying to research the most pragmatic way to add CSRF to this Angular 1.x app. They chose to use the apiController, not so outside sources could call the api, but solely for GET and POST operation from this single page app done in TypeScript. I'm going to experiment and try adding an HttpFilterCollection ( https://stackoverflow.com/questions/32460196/angularjs-web-api-antiforgerytoken-csrf )and see how that does or doesn't work. You can mark this as closed, and I'll report back, just to spread the knowledge. 🏫 😃

from security-code-scan.

ericop avatar ericop commented on May 17, 2024

Okay, so as I was trying this up, I just went back in and now I have stuff. Not sure if rebuild took a while, as I wasn't watching, or Roslyn was slow, but after about 2 minutes from build, now I'm seeing stuff
snip_2018-03-06 13h57m52s

from security-code-scan.

ericop avatar ericop commented on May 17, 2024

Few Questions:

  1. Is this lag normal?
  2. Do you know if a VS2017 reboot is needed after setting [x] “Enable full solution analysis” ?
  3. Does this tool not work on System.Web.Http.ApiController ?

This thing seems really cool. I'm grateful for the work you've put in on it! I'm just trying to make it clear for others who install it how to a) get it functional b) what limitations it has for scanning certain controller types.

from security-code-scan.

JarLob avatar JarLob commented on May 17, 2024
  1. The lag depends on the size of solution. I wouldn't say it's normal. On my computer it is usually much faster. But sometimes projects in solution tree take long time to load. There is an indicator for that...
    image
    Analyzers also have non intuitive progress indicator:
    image
    If there are three dots next to Error List it means some analyzer is still working. Keep in mind, that different analyzer extensions run one by one and some other extension may slowdown overall progress...

  2. My experiments show, that it is not needed.

  3. CSRF analyzer doesn't check for System.Web.Http.ApiController because it looks for System.Web.Mvc.HttpPostAttribute or Microsoft.AspNetCore.Mvc.HttpPostAttribute. Correct me if I'm wrong, but MVC ValidateAntiForgeryTokenAttribute is supposed to be used with MVC. While it is possible to use the attribute in WebApi methods it breaks the usage of the WebApi from non MVC pages. As far I understand common practice is to require an auth token to be passed in a custom header to WebApi method. It is not added automatically differently from cookie, thus making such API immune to CSRF.

from security-code-scan.

ericop avatar ericop commented on May 17, 2024

I ended up combining https://stackoverflow.com/questions/32460196/angularjs-web-api-antiforgerytoken-csrf/32460197#32460197 and https://stackoverflow.com/questions/11725988/problems-implementing-validatingantiforgerytoken-attribute-for-web-api-with-mvc/16092115#16092115 to build a custom ActionFilterAttribute for ApiControllers for anyone who stumbles upon this later.

from security-code-scan.

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.