-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate phplist\index.php (and other subscriber facing UI) from Admin parts #336
Comments
why so complicated with a Rewrite to block access. Just a simple require line would be sufficient. I don't think any shipped frontend code is in the admin folder, but there may be other references to it. Try checking the network connections, when you press F12. The forums are probably a better place to discuss this. |
@michield hi there. As mentioned above, I want to keep my changes separate from phplist, thus I have .htaccess inside my root folder. I don't know how you would tell Apache that you need to restrict "/phplist/admin" only and spit out 403. Anyhow that's not the problem. Unfortunately, the front end code is shared between Admin and Subscriber UI. See screenshot. All the reds are coming from admin/ui or admin/js. Again, as I said there is more to untangling then just copy-pasting css and js and changing the references somewhere in index.php. When I look at it, the index.php requires bunch of other php files (from admin) that in turn require more php files (also from admin). Somewhere inside admin the needed references (to js and css) are eventually made. I can gladly move it to the forum, but I don't see "register" link here. If you implied some other forum please let me know. I will repost there and add a cross-reference here. *reworded |
Interesting. Looks like your Rewrite is blocking too much. Forums are here: https://discuss.phplist.org/ If you find it's a bug, report it here: https://mantis.phplist.org |
@asdr45fsd35fdf Separating the two areas of the application entirely would require more duplication of libraries and complications for translation. Hopefully you can achieve access restriction to the admin pages that you desire with modified rewrite rules. When you do, please can you share what worked here, so that it can be added to the wiki (or add it to the wiki directly yourself)? |
I come up with something that I think works:
At least I've tested multiple scenarios and all looks good. I don't have access to any admin stuff but /phplist/ works fine because css and js from admin are not blocked anymore. I don't know if it covers all the angles. I also don't know if this is the easiest way. If you find anything better, I'm all ears. Sorry, I won't have time to register on phplist.com and create a wiki anytime soon. I'm overwhelmed with my todo list at the moment. If you think this is a good solution (and I assume you have an account with phplist.com) please post that to the wiki. |
@mrojnetsky Excellent thanks, documented here: https://resources.phplist.com/admin_pages_access_control |
I'd like to chime in here if I may. Because of the way my business works (mobile users), I use user certs to restrict access to admin functionality on websites. IP restriction won't work for me. The current architecture of phplist doesn't allow for this. Its unfortunate as the content seems to be mainly static? I can understand the developers desire not to duplicate libraries, however the decision to place user content in the admin area should be reviewed as there are security implications. In the short term it would be beneficial if the static content used in the subscription pages was configurable in the config.php, That would at least give people the option to compartmentalise the user pages if they had a reason to. Longer term, a suggested architectural state:
|
@frasersdev Thanks for clearly explaining your use case.
The most important content of the subscribe pages is dymanic -- which attributes are offered, plus default values etc. are loaded from the database.
Do you mean that the location of these files should be configurable, so that other paths can be specified in the config file?
Good idea, though it probably makes most sense to work on this separation for phpList 4 rather than phpList 3. New issue added here: phpList/core#296 |
Hi @samtuke
sorry perhaps I wasn't clear in what I meant. I understand the subscribe page code running on the server includes libraries from /admin. I was only referring to resources being downloaded over http out of the /admin area. On my vanilla install these are:
its all css and js (& static).
Yes, ie
easy to hardlink /shared/ui -> /admin/ui & /shared/js -> /admin/js allows for full gamut of security options operating at the http layer, eg mod_rewrite (as originally posted), .htaccess, users certs... |
agreed and thank you 👍 |
If the references are hard coded, then I can understand this is needed, but the code provided is only there as an example and the expectation is that it is overwritten with a local design, which has its own css and js, pulled from other places (eg from /js and /css and not /lists/js/ or /lists/css/) But yes, I guess the request in this issue could be done. |
Hi @michield Any new subscribe pages generated will of course refer back to resources in /admin/ui - but thats something that can be easily managed. cheers |
I've just logged a separate issue ( #394 ) - thinking through the process as a new user and the decision of adding a index.html (that needs to be edited) and a seperate /lists folder - just want to add a note here in case there is any merit to also looking at the other suggestion if/when doing this :) |
Hi there,
For me, it is a gray area if we should consider it a bug, a design flaw, or a feature request. If you don't agree that it is an issue, please move it to a proper place, or let me know and will recreate it elsewhere.
So in the root folder of my website I have .htaccess file, to which I added the following snippet
RewriteEngine On RewriteCond %{REQUEST_URI} ^/phplist/admin RewriteCond %{REMOTE_ADDR} !=x.x.x.x RewriteRule ^(.*)$ - [R=403,L]
This lets me access the admin section only from my IP and significantly decrease the angles of possible attacks from the bad boys and girls.
However, when I do that the subscriber facing UI looses all the formatting and style. At first I thought I'll do a quick workaround by just copying all the js and css from admin a level up and change the references in index.php. But after quick inspection I doesn't look like it is an easy workaround. The subscriber UI and admin parts are tightly coupled. And untangling them will be a big effort.
Please consider this for future releases. And I will be grateful if anyone has ideas on how to secure Admin without sacrificing Subscriber's UI.
The text was updated successfully, but these errors were encountered: