Uploaded image for project: 'SoftHSM'
  1. SoftHSM
  2. SOFTHSM-51

Incorrect default file permissions on the SoftHSM slots

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.5
    • Fix Version/s: 1.3.6
    • Component/s: None
    • Labels:
      None
    • Environment:

      Observed in Debian (stable) and Ubuntu Saucy

      Description

      When a slot is first initialized, for instance by running the "softhsm
      --init-token --slot X" command, the sqlite database is created with the
      uid:gid of the user that has runned the command. Default DAC
      permissions are defined by the current umask of the running shell.

      On my system, and I believe in most systems, the umask is too permissive
      for the authorization levels required for such cryptographic containers.
      By default, on my system, my slots are created with the 644
      permissions, which makes my token world-readable.

      It is my understanding that the sqlite_open function prototype does not
      allow to specify the default permissions in case the sqlite database
      does not exist.

      I believe the current umask should be saved and a more restrictive umask
      should be set before the sqlite_open call is performed. After the call,
      the saved umask could be restored.

      A restrictive umask of 117 would do, but I would prefer a paranoid umask
      of 177. Investigations should however be performed: although it
      enforces default permissions similar to /etc/ssl/private/* and
      .ssh/id_rsa, it may break compatibility with existing systems.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jakob Jakob Schlyter
              Reporter:
              jakob Jakob Schlyter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h