Not blocking pages really

Created on 1 February 2018, almost 7 years ago
Updated 13 March 2023, almost 2 years ago

1. Enable Restricted IPs
and give a list of allowed IP addresses

2. enable Check IP addresses only on the following paths
for example:
/protected_page

3. Access the /protected_page from any IP address not in the list of allowed IP addresses. Good! The illegal client is blocked as expected.

But, after any client from the list of allowed IP addresses successfully accesses the /protected_page, the illegal client can successfully access the /protected_page at the same time too!!!

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΉπŸ‡ΌTaiwan Tzu-Chi Huang

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    We've looked at the code. This will likely still be an issue in 4.x

    I also need to file another issue about how restrict_ip_js_alter() can break JS rendering for anonymous users. Essentially, core will cache the partial JS payload and not reset that for anon users who *are* on the proper ip.

  • Status changed to Active almost 2 years ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @agentrickard! This is absolutely possible. We also found several things that could / should be improved after becoming Co-Maintainers a while ago.

    Would it make sense for you to become (co-)maintainer and help to push things forward here?

  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    I don't have a ton of time right now, though I am trying to unblock a project. It can't hurt to give me access, though I can't promise anything.

    For page-level caching, we had to use a ServiceProvider override to override the core getCacheId() method to add an "ip_allowed" or "ip_deneid" string to the cache id.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @agentrickard thanks, I think anyone with a lot of experience, like you, can help to push things forward here. I'll add you as co-maintainer.
    Hopefully we all can improve things here sooner or later.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    PS: And we should have tests, whereever possible!

Production build 0.71.5 2024