Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:43:09+00:00 2026-05-28T07:43:09+00:00

I have a site running in Integrated mode on IIS7 and have changed the

  • 0

I have a site running in Integrated mode on IIS7 and have changed the web.config so the static files are authenticated. What I would like to fix is when a request for a not existing file comes in, it still goes through the .NET authentication pipeline, I see by debugging Begin_Request() method that the request is made for /login.aspx?returnurl=filenotfound.js (paraphrasing here).

Has anyone got any tips on how to catch and return the 404 before the authentication kicks in?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:43:09+00:00Added an answer on May 28, 2026 at 7:43 am

    My main bit of advice would be; don’t.

    If you require authentication on certain resources, then you’ve presumably got something to hide. When you’ve got something to hide, you should pay attention to what you are revealing, and when you are giving a different response for a resource that has a file for it and one that doesn’t you are revealing something.

    Is this a major security hole? I can’t say, but it could be enough to reveal something to an attacker. It’s certainly and enlargement of the attack surface, so you’ve got two options.

    1. Do painstaking analysis to prove that the information on which URIs are mapped to files and which aren’t is of no benefit to an attacker.
    2. Require authentication for the request even though all it will give an authenticated user is a 404.

    The latter is easier and less error prone.

    That said, there’s a few ways to do authentication in ASP.NET with integrated mode. Are you doing it in modules that handle the AuthorizeRequest and AuthenticateRequest events? You could have them check whether such a case is occurring (check whether the URI maps to an existing file or not) and not send a 401 if that’s the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site running on IIS 7.5 with integrated Windows authentication. In
I have a web site running via IIS7 on Vista. The site is running
I have integrated sage pay with my wordpress site. I am currently running sagepay
I have a asp.net 2.0 web site with WCF service hosted inside it running
I have a site built using asp.net mvc running on IIS 7 using integrated
I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site
I have a local site running that is authenticated by an htaccess file which
I have a site running on amazon elastic beanstalk with the following traffic pattern:
I have a site running on Magento and i have build some hand made
I have a site running in django and want to make it available on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.