Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: @rjen on May 23, 2022, 03:48:05 AM

Title: Forum closed for guests results in thousands of errors
Post by: @rjen on May 23, 2022, 03:48:05 AM
Just noticed this by accident.

Doing some test I closed my 2.1.2 test for for Guests by setting it to not "Allow guests to browse the forum".
This morning I found thousands of errors, caused by bots accessing download links to attachments that are no longer accessible to them.

I don't think that should happen..?

How to reproduce?
1. Have a topic in your forum with an attachment that is visible to guests
2. Click to download the attachment
3. Copy the download link
4. Close the forum for guests
5. Logout (or use an incognito window)
6. Try to download the link by pasting the copied link

Result:
a login page stripped of all css
2022-05-23_094315.jpg

and around 90 errors in the log...

In my example it is this link being accessed: https://test.fjr-club.nl/index.php?action=dlattach;attach=22387

And errors from subs.php, like:

QuoteGuest
2a02:a213:a701:c080:e978:66ac:9e70:3ea9
7582d457acd4349c6806adc18fe2249d
https://test.fjr-club.nl/index.php?action=dlattach;attach=22387
/home/deb77453/domains/fjr-club.nl/public_html/test/Sources/Subs-Auth.php (Line 224)  Backtrace information

Type of error: Undefined
Error messageSelect
8: Undefined index: login

and Login.template.php

QuoteGuest
2a02:a213:a701:c080:e978:66ac:9e70:3ea9
7582d457acd4349c6806adc18fe2249d
https://test.fjr-club.nl/index.php?action=dlattach;attach=22387
/home/deb77453/domains/fjr-club.nl/public_html/test/Themes/default/Login.template.php (Line 291)  Backtrace information

Type of error: Undefined
Error messageSelect
8: Undefined index: one_hour





Title: Re: Forum closed for guests results in thousands of errors
Post by: Arantor on May 23, 2022, 04:08:19 AM
This is a bit normal. The attachments URL doesn't load the theme - normally you don't need it to serve attachments.

But it shouldn't vomit errors like that - it never used to IIRC? But maybe I never tried it with the guest access off.
Title: Re: Forum closed for guests results in thousands of errors
Post by: @rjen on May 23, 2022, 05:36:09 AM
Quote from: Arantor on May 23, 2022, 04:08:19 AMThis is a bit normal. The attachments URL doesn't load the theme - normally you don't need it to serve attachments.

But it shouldn't vomit errors like that - it never used to IIRC? But maybe I never tried it with the guest access off.

Neither did I, like I said it was a test forum. And I understand that this link would not need a theme loaded, but yeah IMO it should not throw these errors like it does...

By the way: I just tested the same situation in a 2.0.19 forum

This link:
https://test2.fjr-club.nl/index.php?action=dlattach;ts=1630687984;topic=25434.0;attach=22886

And this actually does load the theme and gives a proper login page and no errors in the log..
So it is a 2.1 bug IMO...
Title: Re: Forum closed for guests results in thousands of errors
Post by: SpacePhoenix on May 23, 2022, 05:49:58 AM
What mods are you using?
Title: Re: Forum closed for guests results in thousands of errors
Post by: @rjen on May 23, 2022, 05:57:43 AM
Quote from: SpacePhoenix on May 23, 2022, 05:49:58 AMWhat mods are you using?

Not relevant: this happens on a 2.1.2 forum without any mods...
Title: Re: Forum closed for guests results in thousands of errors
Post by: @rjen on May 25, 2022, 10:45:30 AM
Quote from: Max22 on May 25, 2022, 10:30:00 AMThe links to the attachments seem to work fine now.

Not sure what you mean to say? I reopened the test forum to guests, so the errors don't pile up anymore.

I am curious to hear from the team if this behavior is intended in SMF 2.1 or indeed recognized as a bug that will be fixed at some point in time..,
Title: Re: Forum closed for guests results in thousands of errors
Post by: Diego Andrés on July 28, 2022, 12:26:58 PM
Did someone log this on gh? I remember commenting that I couldn't reproduce on two different vanilla forums.
Title: Re: Forum closed for guests results in thousands of errors
Post by: Diego Andrés on October 29, 2022, 11:56:57 PM
Sent possible fix: https://github.com/SimpleMachines/SMF/pull/7589