Skip to content

[BUG] BLACKLIST_URI_URLS not blocking URI's #3597

Description

@zynexiz

What happened?

The usage of BLACKLIST_URI_URLS don't seem to block the URI entered for the site. I'm not sure if I misunderstand the purpose, or if this is a bug I have the setting BLACKLIST_URI_URLS=https://cloud.mydomain.se/index.php/login?direct=1 for NextCloud, which should block the access to the default login page for NextCloud. We need this because we have Keycloak IDP that should be used. The problem is that is that link is still accessible for the outside world, an adversary can potentially bypass the IDP and login using a leaked password without MFA thru our federated login.

NextCloud itself don't seem to have a way to block it, and it's still needed for "break the glass" account, so it should be accessible within a certain white lite IP range.

I have tried both BLACKLIST_URI and BLACKLIST_URI_URLS without success. There was some config examples with BLACKLIST_IP_URLS, but that doesn't seem to exist (maybe old example that doesn't work anymore?).

How to reproduce?

Create a BLACKLIST_URI_URLS setting and test it.

Configuration file(s) (yaml or .env)

IS_DRAFT=no
SERVER_NAME=cloud.mydomain.se
USE_TEMPLATE=low
BAD_BEHAVIOR_THRESHOLD=30
BAD_BEHAVIOR_BAN_TIME=10800
BLACKLIST_COMMUNITY_LISTS=ip:danmeuk-tor-exit ua:mitchellkrogza-bad-user-agents ip:laurent-minne-data-shield-aggressive ip:laurent-minne-data-shield-critical
BLACKLIST_URI_URLS=https://cloud.mydomain.se/index.php/login?direct=1
USE_BROTLI=yes
USE_CLIENT_CACHE=yes
USE_CORS=yes
CORS_ALLOW_ORIGIN=*
CORS_ALLOW_METHODS=GET, POST, PUT, DELETE, OPTIONS, PROPFIND, REPORT, MKCOL, COPY, MOVE, LOCK, UNLOCK
CORS_ALLOW_HEADERS=DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
CORS_ALLOW_CREDENTIALS=yes
CROSS_ORIGIN_RESOURCE_POLICY=same-origin
CORS_DENY_REQUEST=no
WHITELIST_COUNTRY=SE
USE_GZIP=yes
GZIP_PROXIED=expired no-cache no-store private auth
KEEP_UPSTREAM_HEADERS=*
CONTENT_SECURITY_POLICY=default-src 'self'; style-src 'self' 'unsafe-inline' https:; script-src 'self' 'unsafe-eval' 'unsafe-inline' https:; font-src 'self' data:; img-src 'self' data: blob:; connect-src 'self' wss:; frame-src 'self';
REFERRER_POLICY=no-referrer
PERMISSIONS_POLICY=
X_CONTENT_TYPE_OPTIONS=
COOKIE_FLAGS=\* SameSite=Lax
AUTO_LETS_ENCRYPT=yes
EMAIL_LETS_ENCRYPT=support@mydomain.se
USE_LIMIT_REQ=no
USE_LIMIT_CONN=no
LIMIT_CONN_MAX_HTTP1=25
LIMIT_CONN_MAX_HTTP2=200
LIMIT_CONN_MAX_HTTP3=200
LIMIT_REQ_RATE=20r/s
LIMIT_REQ_URL_1=/apps
LIMIT_REQ_RATE_1=5r/s
LIMIT_REQ_URL_2=/apps/text/session/sync
LIMIT_REQ_RATE_2=8r/s
LIMIT_REQ_URL_3=/core/preview
LIMIT_REQ_RATE_3=5r/s
ALLOWED_METHODS=GET|POST|HEAD|COPY|DELETE|LOCK|MKCOL|MOVE|PROPFIND|PROPPATCH|PUT|UNLOCK|OPTIONS|REPORT
MAX_CLIENT_SIZE=10G
LISTEN_HTTP=no
MODSECURITY_CRS_PLUGINS=nextcloud-rule-exclusions
REMOTE_PHP_PORT=
USE_REAL_IP=yes
REAL_IP_FROM=10.x.x.x/22
USE_REVERSE_PROXY=yes
REVERSE_PROXY_INTERCEPT_ERRORS=no
USE_PROXY_CACHE=yes
PROXY_BUFFERS=16 512k
PROXY_BUFFER_SIZE=256k
PROXY_BUSY_BUFFERS_SIZE=1024k
REVERSE_PROXY_HOST=http://nextcloud # Load balancer
REVERSE_PROXY_WS=yes
USE_ROBOTSTXT=yes
ROBOTSTXT_COMMUNITY_LISTS=ai-robots-txt robots-disallowed
SELF_SIGNED_SSL_SUBJ=/CN=mydomain.se/
REDIRECT_HTTP_TO_HTTPS=yes
WHITELIST_RDNS=
WHITELIST_ASN=

Relevant log output

BunkerWeb version

1.6.10

What integration are you using?

Docker

Linux distribution (if applicable)

Debian 13

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions