rejetto forum

Warning: HFS v2.x has a severe vulnerability

LeoNeeson · 39 · 131125

0 Members and 4 Guests are viewing this topic.

Offline danny

  • Tireless poster
  • ****
    • Posts: 289
    • View Profile
Edit:  Here is an approach with Auto-Ban.   This will not catch everything--keep scrolling, several posts further down.
in hfs.events (alt+f6)
Code: [Select]
[+request]
{.if|{.match|*filter=*.exec*;*search=*.exec*;*.exec*;*%host%*;*_host_*;*cmd.exe*;*&cmd=*;*powershell+*;*/wp-includes/*|%url%.}|{:
{.set|n|{.from table|#tries|%ip%.}.}{.inc|n.}{.set table|#tries|%ip%={.^n.}.}
{.if|{.{.^n.} > 0.}|{:
{.set ini|ban-list={.no pipe|{.from table|#ini|ban-list.}%ip%#AutoBan {.time.}.}.}{.set table|#tries|%ip%=0.}
:}/if.}
{.disconnect.}{.add to log|%ip% %user% BANNED FOR POSSIBLE SECURITY THREAT.}:}.}
Note:  This is possibly useful in combination with the TINYWALL firewall project, an egress blocking firewall, whereby you'd let through (allow) your web browser, HFS (possibly unblock lan), and very little else.  Newer version or there is also older version (for older server).
« Last Edit: July 10, 2025, 01:55:24 AM by danny »


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 873
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
in hfs.events (alt+f6)
Code: [Select]
[+request]
{.if|{.match|*filter=*.chr*;*search=*.chr*;*filter=*.save*;*search=*.save*;*filter=*.section*;*search=*.section*;*filter=*.break*;*search=*.break*;*filter=*.move*;*search=*.move*;*filter=*.set*;*search=*.set*;*filter=*_host_*;*search=*_host_*;*filter=*%host%*;*search=*%host%*;*filter=*.exec*;*search=*.exec*;*.exec*;*%host%*;*_host_*;*.chr*;*.exe*;*.bat*;*.ps*;*.com*;*.php*;*.py*;*.vbs*|%url%.}|{:{.disconnect.}{.add to log|%ip% %user% IS DENIED.}:}.}

Is that a good approach?  And, if so, how much of that filter is actually needed?  Thanks!!!
Hey Danny, good to see you again! :D

Unfortunately, none of those filters are going to stop this vulnerability, and they're not really useful in this specific situation. You can use them if you want, but they won't do anything to prevent this.

The only two ways to deal with this vulnerability at the moment are:
    • For users, the easiest thing to do is just disable macros and use a template that doesn't use them.
    • For programmers, the other option is recompiling the executable (after fixing the function that allow this vulnerability).

    - To disable macros, follow these steps, described HERE.
    - Then, you can use a template like these, found HERE.

    (That should keep you safe from the vulnerability!)

    That’s all we've got for now. Hope it helps! :)

    Cheers,
    Leo.-
    HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
    » Currently taking a break, until HFS v2.4 get his stable version.


    Offline danny

    • Tireless poster
    • ****
      • Posts: 289
      • View Profile
    Hi Leo!  Thanks for the reply.  Thanks for the compiling guide! 

    Patched edition available at http://software.run.place
    Macros are disabled.  New Throwback15 template added.

    Is there a way to do New Folder with macros off? 

    « Last Edit: July 03, 2025, 02:56:20 AM by danny »


    Offline LeoNeeson

    • Tireless poster
    • ****
      • Posts: 873
    • Status: On hiatus       (sporadically here)
      • View Profile
      • twitter.com/LeoNeeson
    Hi Leo!  Thanks for the reply.  Thanks for the compiling guide! 

    Patched edition available at http://software.run.place
    Macros are disabled.  New Throwback15 template added.

    Is there a way to do New Folder with macros off?
    Hey Danny! It's nice you did your custom version. :D I'm glad you liked and found my guide to compiling HFS helpful. The following message below is what I wrote yesterday before going to sleep (replying your original message), which I'll leave here anyway...



    Hi Leo!  Thanks for the reply. 

    Is it possible to get a patched copy of HFS 2.3K, 2.3L or even 2.3M?
    The "K" and "L" withstand gigabit slightly better than the "M" version.
    However, I don't need 2.4 because it locks up under gigabit load.

    So, file download location of patched HFS 2.3 ?
    • Officially, there isn't a "patched" version of ANY version of the whole version 2 (since Rejetto, is now focused on the new version 3), nor do I have any (personal) version ready to share (if I had it, I would gladly share it, but I still have nothing ready).
    • Unofficially, anyone can compile HFS from the source code and modify it to avoid this vulnerability. You'd need a copy of 'Turbo Delphi' or some later version, though. You can check my tutorial "How to compile HFS" if you wish.
    Sadly, I don't have the time to continue with this anymore, at least for the foreseeable future. I only have like 10 or 20 minutes a day to reply to messages, and programming just takes up way too much time – time I don't have right now. It's not a lack of motivation, but circumstances beyond my control (my parents' health), that are keeping me from continue working on this. I just can't give you any date on when I'll have free time again to get back to this, but don't lose hope!. And thanks for your hosting offer, I appreciate it.

    You can try some of the other 'code change' suggestions I've left on this thread (if you want to compile the source code yourself, but you will be on your own with this), or, even better, use another "fork" (unofficial version) of HFS, like any of the options described in this thread. But, what version you choose is totally up to you. The easiest option right now is to just stick with any -official- HFS version 2 (preferably the latest), with macros disabled for now. Or, you could always upgrade to HFS 3 to make Rejetto happy! ;)
    HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
    » Currently taking a break, until HFS v2.4 get his stable version.


    Offline danny

    • Tireless poster
    • ****
      • Posts: 289
      • View Profile
    For patched version of HFS2.3K, I've added many layers of defense. . . and *Might have solved/reduced the gigabit freeze problem. 
    http://software.run.place
    locate hfs23-K-patched.zip and you can test it out. 
    The site to download it, is running that same copy of HFS2.3K, with the macros on. 


    Offline danny

    • Tireless poster
    • ****
      • Posts: 289
      • View Profile
    Speedup: 
    locate hfs23-K-patched3.zip and you can test it out. 
    http://software.run.place
    It is running that same copy of HFS2.3K, with the macros on.

    Thanks to Leo for help in bypassing the always-on limiters, and this prevents freezes.  Also, I raised the console TTL so the UI stays responsive. 

     Edit:  For round 3:  Thanks to Leo for updated code that blocks hfs-specific attack, in the .exe, without reliance on any particular template.  So, you can use any template that you want to.
     
    Included in the zip file is now the legacy default template for HFS2.3M, Leo's portable edition (jquery is aboard the template), and I have altered it slightly, so it can run well on the security-patched edition of HFS2.3K.  There is the unicode font added to the stylesheet, some necessary size adjustment, and it does not overwork the system icon code.
    « Last Edit: July 15, 2025, 04:03:33 AM by danny »


    Offline LeoNeeson

    • Tireless poster
    • ****
      • Posts: 873
    • Status: On hiatus       (sporadically here)
      • View Profile
      • twitter.com/LeoNeeson
    Thanks to Leo for help in bypassing the always-on limiters, and this prevents freezes.

    Thanks to Leo for updated code that blocks hfs-specific attack, in the .exe, without reliance on any particular template.
    Thanks, Danny, for the acknowledgment, I appreciate it.

    My only contribution was two small code tweaks, which I’ve shared here in case anyone is interested in reviewing or using them.

    Keep up the good work!
    Cheers,
    Leo.-
    HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
    » Currently taking a break, until HFS v2.4 get his stable version.


    Offline danny

    • Tireless poster
    • ****
      • Posts: 289
      • View Profile
    I've also added security-patched HFS2.3-M with minimal modifications. . . for if you want something as close to original as possible. 
    It has added several security filters, slightly more tolerant GUI TTL, added unicode font for file-list; yet also, removed system icon freezes and archive freezes. 

    The archive button will appear IF a logged-in user has delete permissions. This strong protective measure keeps bots from using archive, and also keeps basic users from crashing the server while filling up their smart-phones with huge .tar files (a double-edged hazard).  However, advanced users (who can delete and possibly know what .tar files are) can use archive.

    The security-patched copy of "M" is specifically made for accommodating personal preferences of using that version and its many original features. 
    It is possible that the security-patched "K" version may be more reliable on fast gigabit connections, due to having simplified features.

    Edit:  If you see some log junk representing huh?  Scuse me?  Those are caused by contingency filters altering hack input into a form that doesn't function. The .events file isn't required.  Several layers of security filters are hard-coded into the .exe file for the patched M and patched K versions.
    « Last Edit: July 17, 2025, 02:42:14 PM by danny »


    Offline danny

    • Tireless poster
    • ****
      • Posts: 289
      • View Profile
    HFS2.3K p4 is ready
    The update is for better responsiveness.


    The server that you download from, is running that exact same copy of HFS2.3K 299p4.


    P.S. Just in case you happen to have a custom template that requires jquery:  Either you can use the "m" version that has the historic feature set (some that aren't optimal for gigabit); Or for the streamlined version "k", both of Leo's methods to update your jquery-reliant template, are nicer than fetching jquery out of the .exe.  Then you'll be ready for when/if we get version 2.4 up to date.  You can see the included "legacy template.tpl" file as an example of onboarding jquery.  The new copy in my .zip file is slightly modified to include unicode fonts and a shielded archive link so that bots can't use it to archive the whole thing.

    P.P.S. I have updated my router to run banip with fail2ban/debl and greensnow, so that crude ip country/range blocking is longer required. 
    Also, these new patched versions of HFS are hard-coded to react to HFS specific attack by banning ip, which limits experiments considerably.
    « Last Edit: July 17, 2025, 10:05:03 PM by danny »