‹ BackHN Continuity

Thread

Microsoft killed FoxPro in 2007. Anyway, here's FoxPro revived

487 points · 270 comments · boredjohnny

  1. mikestew · · focus · HN ↗
    Here’s my problem with reviving FoxPro in any form: there’s a huge security hole in the Database Container (DBC) design. For DBCs to be useful, they must be read/write to all users (there is no permissions scheme). DBCs have stored procedures that can run any FoxPro code, including Win32 calls made from the FoxPro runtime. The stored procedures are stored as plain text in a “memo” field. Do you see where this is going? With a little technical knowledge, one can modify that INSERT trigger to whatever you like. EDIT: as the DB is just files in the file system, modifications can be made using a text editor, bypassing any checks in the FoxPro runtime. FoxPro just executes what it finds in there.

    My recommendation is to get rid of the DBF/DBC files and move to a SQL DB of some flavor ASAP. If you have the source code, use ODBC or OLE DB to point to a server.

    Source: filed that bug over 20 years ago when I worked on the Fox team. No, it wasn’t going to get fixed without rewriting large parts of how the DB engine worked.

    1. userbinator · · focus · HN ↗
      there is no permissions scheme

      If you already have full access by design, then there's no "huge security hole" either.

      1. EvanAnderson · · focus · HN ↗
        Exactly. It's not a security hole. It's just the architecture of the program.

        It seems like many people have a hard time understanding this, including developers.

        Any attempt to add any kind of permissions, security, etc, without addressing the nature of the architecture (that the database engine runs in the same address space / security context as the UI) misses the point.

        1. shermantanktop · · focus · HN ↗
          You’re saying it’s not a 2 tier client/server app, it’s a one tier app with no intermediate API to define or enforce permissions. Fine.

          But the filesystem access to read/write the db files creates a path to bypass half of that application.

          Does the application checksum the db file and have any resistance to filesystem tampering? That'd be trivial to beat, I’m sure, but it’d be something.

          1. lelanthran · · focus · HN ↗
            > But the filesystem access to read/write the db files creates a path to bypass half of that application.

            Is there any local/native application for which this is not true?

            1. shermantanktop · · focus · HN ↗
              With a permissions system that’s meant to enforce security? I hope not.

              I’m not a FoxPro user and so maybe these are single-user/single-host installs, where the user can only destroy their own data, and permissions are a pretend feature. In which case, carry on.

              1. 306bobby · · focus · HN ↗
                Can't you just use filesystem permissions? Like, FoxPro under its own user and it's database owned and accessible by FoxPro user only?
                1. EvanAnderson · · focus · HN ↗
                  Sure. The user would need to logon as the FoxPro user to use the application. At that point, having the FoxPro user credentials, the user can manipulate the FoxPro data files directly without using the application.

                  The rub here is that FoxPro is an in-process database engine and accesses its data files with the security context of the user running the application. It doesn't have separation between the database engine and the UI like a client/server database would. Think of it like SQLite or BerkeleyDB.

                  Architecturally users who use the application need full read/write access to all the data files for FoxPro to work.

              2. lelanthran · · focus · HN ↗
                > With a permissions system that’s meant to enforce security? I hope not.

                There's different needs for a permissions system.

                You're thinking of it as "lock to the main entrance of a maximum security prison". Think of it more as a lock on a bedroom door: it's not there to withstand a SWAT assault, it's there to keep people from accidentally walking in.

                All local applications (which were all applications in the era we are talking about) with permissions were sold to companies on the understanding that there was no real security.

                Hell, even the networked products at the time had no real security :-/

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.