[DBTech] DragonByte Security

[DBTech] DragonByte Security [Paid] 5.3.0

No permission to buy (€14.95)
It’s always better to post @ my site to avoid issues getting lost, sometimes I check this site on a device other than my work computer and things can slip my mind, sorry about that 😅

I’ll look into it as soon as I can.

I'll keep that in mind, and thanks :)
 
DragonByte Tech updated [DBTech] DragonByte Security with a new update entry:

5.1.3

Update highlights​

This version improves the search feature in the various log pages by doing a better job carrying over any criteria, making it easier to refine your searches.

Furthermore, a fix has been added to prevent server errors that could break the login flow if the HaveIBeenPwned API returned unexpected data.


Complete Change Log​

Change: Criteria are now carried over when clicking the Search button in log pages
Fix: Fix cache...

Read the rest of this update entry...
 
I don't know if I'm missing a setting somewhere, but yesteday I had a security issue get emailed to everyone who is an admin. I don't want that. I should be the only one receiving the emails. The other admins only have permissions to edit a user's profile, and post notices. I would technically be a "super admin."
 
Hi,

I've encountered an issue with the Tor exit node update cron in DBTech Security.

On two consecutive daily cron runs, the request to the Tor Project bulk exit list failed with the following exception:

Code:
GuzzleHttp\Exception\ConnectException:
cURL error 35: Recv failure: Connection reset by peer

The exception occurs while TorRepository::updateNodes() is fetching the Tor bulk exit list.

I had a look at the exception handling around this request and noticed that it currently catches RequestException:

PHP:
catch (RequestException $e)
{
    \XF::logException($e, false, "[Security] Error fetching TOR exit nodes: ");
    return;
}

However, in these two cases Guzzle threw GuzzleHttp\Exception\ConnectException.

As ConnectException is not a subclass of RequestException, the existing catch block does not handle this particular connection failure. The exception therefore propagates into XenForo's server error log instead of following the intended graceful failure path.

Perhaps ConnectException could also be handled here, or the appropriate broader Guzzle exception type could be caught.

I also tested the same Tor endpoint directly from the server afterwards. It is currently working normally:

Code:
HTTP: 200
TLS verification: OK
Response size: 21535 bytes

So the original connection resets appear to have been temporary rather than a persistent connectivity problem.

There is also one minor observation which may be worth reviewing.

The request currently uses the bulk endpoint in this form:

Code:
https://check.torproject.org/torbulkexitlist?ip=<host>&port=<port>

According to Tor Project's 2020 changes to the bulk exit list service, exit-policy-based queries are no longer supported and the bulk list is returned regardless of the query.

For comparison, I tested both the query form used by the add-on and the endpoint without query parameters. Both responses had exactly the same size and SHA-256 hash.

This does not appear to be related to the connection reset itself, but the ip/port parameters may now be obsolete.

The existing behavior of retaining the current Tor node data when the remote request fails looks correct. The main issue I'm reporting is that a temporary connection-level failure can currently escape the exception handler and become a XenForo server error.
 
I don't know if I'm missing a setting somewhere, but yesteday I had a security issue get emailed to everyone who is an admin. I don't want that. I should be the only one receiving the emails. The other admins only have permissions to edit a user's profile, and post notices. I would technically be a "super admin."
This happens when you have setup a security watcher to trigger "Admin lock". Editing a user profile is exactly the admin permission needed to unlock an account. You can avoid using that feature if you don't want admins to be emailed.

However, in these two cases Guzzle threw GuzzleHttp\Exception\ConnectException.
I'll change that for the next version, thanks :)
 
DragonByte Tech updated [DBTech] DragonByte Security with a new update entry:

5.1.4

Update highlights​

This version attempts to make further improvements to fix a reported deadlock with updating session records.

Furthermore, an issue with the TOR Exit Node cron job potentially erroring due to temporary connection failures has been addressed.


Complete Change Log​

Fix: Attempt to fix deadlocks on session update
Fix: Handle additional exceptions when fetching TOR exit nodes

Read the rest of this update entry...
 
Does not work with taptalk !!
This is Tapatalk's fault. It has been causing problems since its inception, I honestly didn't even realise anyone still uses it. That being said, your ticket @ my site is open and will be addressed in the next update.
 
DragonByte Tech updated [DBTech] DragonByte Security with a new update entry:

Hotfix

This add-on has been hotfixed to address an issue affecting all front-end pages while this add-on is enabled. This issue was caused by additional security measures introduced in XenForo 2.3.13.

The latest version has been patched, and can be downloaded at no additional cost. If you are running an older version and you are unable to upgrade for whatever reason, please let me know the exact version you are running and I will apply the hotfix accordingly.

Read the rest of this update entry...
 
Hello,

DragonByte Security 5.1.4 appears to have the same XenForo 2.3.13 compatibility issue that was addressed by the hotfixes for DragonByte Credits and eCommerce.

Enabling DragonByte Security causes the public-facing site to immediately render blank pages and generates a very large number of the following errors:

Code:
LogicException: Template public:PAGE_CONTAINER error: Cannot modify container while locked
src/XF/Container.php:325

The stack trace points directly to the DragonByte Security copyright callback:

Code:
#0 src/XF/Container.php(111): XF\Container->assertNotLocked()
#1 src/XF/Container.php(68): XF\Container->set('dbtech_branding', Array)
#2 src/XF/App.php(2923): XF\Container->offsetSet('dbtech_branding', Array)
#3 src/addons/DBTech/Security/Template/Callback/Copyright.php(40): XF\App->__set('dbtech_branding', Array)
#4 src/XF/Template/Templater.php(1911): DBTech\Security\Template\Callback\Copyright::getCopyrightText(...)

Disabling DragonByte Security immediately resolves the blank-page issue and stops these errors. Credits and eCommerce have already received hotfixes for this issue, but I could not find an equivalent hotfix for DragonByte Security. Could you please provide the same fix for DragonByte Security?
 
Hello,

DragonByte Security 5.1.4 appears to have the same XenForo 2.3.13 compatibility issue that was addressed by the hotfixes for DragonByte Credits and eCommerce.

Enabling DragonByte Security causes the public-facing site to immediately render blank pages and generates a very large number of the following errors:

Code:
LogicException: Template public:PAGE_CONTAINER error: Cannot modify container while locked
src/XF/Container.php:325

The stack trace points directly to the DragonByte Security copyright callback:

Code:
#0 src/XF/Container.php(111): XF\Container->assertNotLocked()
#1 src/XF/Container.php(68): XF\Container->set('dbtech_branding', Array)
#2 src/XF/App.php(2923): XF\Container->offsetSet('dbtech_branding', Array)
#3 src/addons/DBTech/Security/Template/Callback/Copyright.php(40): XF\App->__set('dbtech_branding', Array)
#4 src/XF/Template/Templater.php(1911): DBTech\Security\Template\Callback\Copyright::getCopyrightText(...)

Disabling DragonByte Security immediately resolves the blank-page issue and stops these errors. Credits and eCommerce have already received hotfixes for this issue, but I could not find an equivalent hotfix for DragonByte Security. Could you please provide the same fix for DragonByte Security?
Please see the post directly above yours as well as the announcement here: https://www.dragonbyte-tech.com/threads/hotfixes-for-xenforo-products.27015/ which also mentions DB Security :)

Simply re-download v5.1.4 and re-import it via the archive installer to receive the fix.
 
DragonByte Tech updated [DBTech] DragonByte Security with a new update entry:

5.2.0 Beta 1

Update highlights​

!!! This version requires PHP 8.2 !!!

This version features multiple big new features and changes, all requested by you. I hope you enjoy 😄

The biggest new addition is Cloudflare integration. You can now optionally use Cloudflare to block countries - either in addition to, or instead of, the regular XenForo IP banning feature. Furthermore, banning an IP address via Cloudflare is now a possible security watcher action, just...

Read the rest of this update entry...
 
Some feedback after running the beta version through our SDLC gate checks. (plus one from v5.1.4)

1) In the beta version, it appears that the uninstall process has been broken:

UninstallStep2 drops the dbtech_security_comment column from xf_ip_match; uninstallStep3 (runMiscCleanUp()) then queries that same column. This was reproduced three times on the beta. We round-tripped 5.1.4 in the same isolated environment (fresh XF 2.3.13, PHP 8.4.25, etc.) and uninstalled without error, confirming this regression was introduced by the 5.2.0b1 rewrite. The add-on gets stuck mid-removal with no working retry path.
Setup.php:219-272
Install/UninstallDataTrait.php:42-45

2) In both 5.1.4 and the 5.2.0 Beta, country ban lists are fetched over http:// from ipdeny.com with no integrity check, then inserted directly into the ban table. Low risk probably, but a MITM'd response could ban the entire internet from the forum (worst case :D). Https seems to work with the link you're using to capture that data.

Will circle back if anything else comes up. (y)

Edit: We did also cover 8.3, 8.4 and 8.5 with no notable issues so far.
 
1) In the beta version, it appears that the uninstall process has been broken:
That is...quite the oversight on my part 😅 Shows how long since I touched the Setup.php file itself, haha. I'll reshuffle the files so Step 3 becomes Step 1, etc. Thanks!

2) In both 5.1.4 and the 5.2.0 Beta, country ban lists are fetched over http:// from ipdeny.com with no integrity check, then inserted directly into the ban table. Low risk probably, but a MITM'd response could ban the entire internet from the forum (worst case :D). Https seems to work with the link you're using to capture that data.
Interesting, thank you for checking and letting me know! From my git history I can see I originally created the feature in 2019, so perhaps they didn't have a HTTPS certificate at that point, or (like the old Country VAT rate APIs I used for eCommerce at one point) they charged for HTTPS.

In either case, updated for the next version 👍

Will circle back if anything else comes up. (y)
Thank you very much, I greatly appreciate it :D
 
  • Like
Reactions: ENF
This update resurrects Bad Behaviour, which is really interesting as it has been a very impressive tool in the past. And now it may just be what the doctor ordered to resolve the endless AI scraper attacks.

Does anyone know if this plays nice with @digitalpoint 's AppforCF and @Xon 's Signup Abuse? Both awesome addons I cannot do without.
 
@Xon 's Signup Abuse? Both awesome addons I cannot do without.
We tested this one directly since it's a core product we use as well. There were no real conflicts found. This addon and Xon's would probably only overlap when it comes to the IP checking. But, Xon's addon uses XF's core system for this whereas this addon feeds it's own reverse proxy. At most, they could disagree with what a visitors IP actually is, but that's about it.

@DragonByte Tech One thing that we did run across was related to the trusted proxy list for Bad Behavior.

../vendor/badbehaviour/badbehaviour/src/Util/HeaderUtil.php:59-71
PHP:
$addrs = array_reverse(preg_split('/[\s,]+/', $headers_mixed[$header]));
        $trusted_proxies = $settings['reverse_proxy_addresses'] ?? [];

        foreach ($addrs as $addr) {
            $addr = trim($addr);
            if (empty($addr)) continue;

            $is_trusted = !empty($trusted_proxies) ? IpUtil::match_any($addr, $trusted_proxies) : false;
            $is_private = IpUtil::is_private($addr);

            if (!$is_trusted && !$is_private) {
                return $addr;
            }
        }

Repository/WatcherRepository.php:82-86
PHP:
'reverse_proxy' => [
                'enabled'   => (bool) $options->dbtech_security_badbehavior_reverse_proxy['enabled'],
                'header'    => $options->dbtech_security_badbehavior_reverse_proxy['header'] ?: 'X-Forwarded-For',
                'addresses' => [],
            ],

'addresses' => [], << This looks like it's hard coded with no option to populate. There is no admin-facing field in the ACP for entering trusted proxy IP ranges, so the empty array can never be populated. The risk here is when a reverse-proxy support enabled, any visitor could potentially spoof their apparent IP via a forged X-Forwarded-For header, potentially bypassing IP bans, country blocking, and bot detection, with no configuration path available to prevent it.

We could be wrong, but just figured it should be mentioned in case it's an actual gap. If we missed something, please feel free to correct us.
 
Last edited:
'addresses' => [], << This looks like it's hard coded with no option to populate. There is no admin-facing field in the ACP for entering trusted proxy IP ranges, so the empty array can never be populated. The risk here is when a reverse-proxy support enabled, any visitor could potentially spoof their apparent IP via a forged X-Forwarded-For header, potentially bypassing IP bans, country blocking, and bot detection, with no configuration path available to prevent it.
Good shout, will be added in the next update 👍
 
  • Like
Reactions: ENF
Back
Top Bottom