Bug: 3rd Party Integration gone in 1Password 4.4

Options
buggypac
buggypac
Community Member
edited May 2014 in Mac

I noticed that my 3rd Party Integration/bookmarks-default.json was outdated, so I went into 1Password 4.4's settings and Disabled and then Enabled 3rd party Integration again.

Instead of getting a nicely refreshed file, I discovered something much worse: I got no bookmarks-default.json at all.

I tried deleting the "3rd Party Integration" folder and rebooting the computer, turning on and off the setting, etc, but no matter what I tried I was unable to get the file back.

Seems like somewhere along the line, a bug has been introduced in the bookmarks-default.json export function and it no longer creates a file.

Can anyone else see this behavior? You have to disable and re-enable "3rd party integration". If it's anything like what I am experiencing, you will no longer have a "bookmarks-default.json" after that...

Comments

  • buggypac
    buggypac
    Community Member
    edited May 2014
    Options

    Coincidentally, the reason that I discovered the bug was that I made a quick and dirty tool to check all of my 167 websites via your Watchtower service. I didn't want to manually check them one by one. That would have taken me like two hours. Instead, I spent 10 minutes programming a tool that uses the 3rd party integration file to retrieve a list of all domains stored in the 1Password database, and checks all of them via your service and prints the results.

    This has two effects: It lets you read the instant status on the command line. And it also makes the watchtower service aware of your sites, so that any vulnerability-results will show up in the automatic database inside 1Password 4 from then on (after waiting an hour and hitting "Update Watchtower database" inside 1P4).

    The only reason that this had to be programmed was that 1P4 doesn't provide any way of "submit all of my sites to Watchtower" internally...

    Save as watchtower.php and run with "php watchtower.php" in the terminal.

    Example output:

    • 1/66: MySteinberg

      • www.steinberg.net
      • Status: Not Vulnerable - Not vulnerable to Heartbleed, but certificates have not been updated.
      • Recommendation: Although www.steinberg.net is not vulnerable to Heartbleed, their certificates may not have been updated.
      • Special Notes: Received an unexpected response when querying the server
    • 2/66: Sample Magic User Area

      • www.samplemagic.com
      • Status: Not verified - This site is not vulnerable to Heartbleed. The identity of the certificate could not be verified.
      • Recommendation: If your password has not been changed since April 07, 2014 then you should change it now.

    Watchtower.php:

    http://pastebin.com/rxtFu6ec

    It's not really related to the bug but I just threw this out there as an aside, in case it helps other people with lots of sites to check...

  • buggypac
    buggypac
    Community Member
    edited May 2014
    Options

    I have found the cause of the bug! Scroll down to the Edit below:

    I've now confirmed this on a 2nd computer which was running beta 4.3-something (the last beta before 4.4 came out), which means that the bug was introduced even further back.

    Here's something fun:

    • Disabling "3rd party integration" causes bookmarks-default.json to be deleted
    • Enabling "3rd party integration" does NOT cause bookmarks-default.json to be created again.
    • BUT: BEFORE I did the disable/enable-dance that caused the file to be deleted, I actually HAD the file thanks to an earlier version having created it, AND it was being kept UPDATED by the latest 1P4.
    • This means: 1P4 is now unable to CREATE a NEW bookmarks-default.json, but it WILL maintain any existing file that was in the folder. This shows that the bug could have existed for a long time with nobody noticing.

    Edit: Hmm, I just did some more testing:

    • If I use Time Machine to RESTORE a valid bookmarks-default.json file, and then MODIFY any item inside of 1P4, it will cause the whole bookmarks-default.json file to be refreshed/rewritten. This was on 1P4 4.4! It gives me an idea...
    • Next, I tried disabling/re-enabling "3rd party integration" to cause 1P4 to delete the file again, then deleted the whole "3rd Party Integration" folder to start fresh, re-started 1Password 4, made sure that "3rd party integration" was still enabled (with no file existing), and then I tried MODIFYING an item in 1P4... and: Nope, it did NOT cause bookmarks-default.json to be created.

    There you have it! I have isolated the bug to this:

    • If there is no bookmarks-default.json file already, then none will be created (this is the bug). If one exists, it will be maintained. If you disable/re-enable "3rd party integration" then the file will be deleted and then not re-created, due to this bug.
  • MikeT
    Options

    Hi @buggypac!

    Can anyone else see this behavior? You have to disable and re-enable "3rd party integration". If it's anything like what I am experiencing, you will no longer have a "bookmarks-default.json" after that...

    Did you do this while you were in a secondary vault? We're tracking down a bug where if you're in a secondary vault, it will not create the file.

    If you were in the primary vault, it does work for me. Even on a fresh install that never had this feature enabled before and thus the file was never created before.

    The only reason that this had to be programmed was that 1P4 doesn't provide any way of "submit all of my sites to Watchtower" internally...

    At the moment, this is intentional for privacy reasons. We wanted to get the first implementation of Watchtower out as soon as possible and from there, we'll keep improving the service on both sides (the web service and the apps). Your request to have 1Password submit sites saved in its database might happen as long as the user permits it first and as long as we have an encrypted but more importantly, anonymous method of transmitting the list of sites. If we cannot provide this, then it is likely we may never add this feature.

  • buggypac
    buggypac
    Community Member
    edited May 2014
    Options

    Hello @‌MikeT

    Your request to have 1Password submit sites saved in its database might happen as long as the user permits it first and as long as we have an encrypted but more importantly, anonymous method of transmitting the list of sites.

    Okay. The unfortunate thing is that Watchtower isn't very effective against Heartbleed without an auto-submission feature. It's very misleading to have a "Watchtower" section that supposedly gives users vulnerability-info for their sites, without telling them that most of their sites aren't even tested (unless they manually type them in on the watchtower website) and therefore won't be listed. The current system also suffers from stale results, due to someone perhaps testing a site 14 days ago and then never again, which means that everybody with that particular site in their DB might see it as "vulnerable" when it no longer is, or whatever.

    Not sure you guys have time for programming an auto-submission system, but just throwing these ideas out there for how it can be structured server-wise:

    HTTPS with the valid certificate signature built into the app to prevent impersonation. Make a server that sits behind Cloudflare (which won't log the customer's HTTPS POST submissions) and have a back-end script that likewise doesn't log the request or the originating IP, just the list of domains. This will be anonymous, since your server will only see the Cloudflare IPs in your access logs (since the actual, real customer IP is in an extra "proxy" header by Cloudflare, See: https://support.cloudflare.com/hc/en-us/articles/200170786-Why-do-my-server-logs-show-CloudFlare-s-IPs-using-CloudFlare-).

    That makes it anonymous enough.

    Make sure that the 1P4 client only uploads a list of domains; not the full URLs. I.e. www.sensitivesite.com rather than www.sensitivesite.com/secreturl. And make it submit them all at once in one big, efficient blob for delayed-processing by your server.

    Then make your back-end script merge the incoming blob of the customer's domains into a global queue of "incoming domains," which is de-duplicated-on-merge (since lots of customers have the same sites and we only want to add one entry for each).

    Then periodically run a cron job on this "incoming" list, which scans through the entire list of domains that people have auto-submitted and throws away all entries that it has already RECENTLY tested (keep a separate DB of the last test-time of all domains), and then pushes all remaining, new sites / sites not tested in a while into a 2nd queue for further processing. When this step is done, you can clear the current "incoming" queue.

    Then have a 2nd cron job which runs through the 2nd queue of sites-to-actually-test and performs the testing, and then pushes those results into a 3rd queue of finished test-results.

    Lastly, have a 3rd cron job which reads the queue of finished test-results once per hour or so, and merges the new results into the vuln.sqlite database on the server, that customers finally download.

    Also remember to use a read/write lockfile for each individual queue so that the 3 separate cron jobs don't attempt to modify the same files at the exact same time due to their intervals periodically overlapping. That would be bad.

    That's how I would design an anonymous, load-balanced system that can handle the volume of sites that would be constantly flooding in via customers. Queue, de-duplicate and rate-limit as much as possible. Consider using a Node.JS server and keeping all of the 3 queues in-memory and it'll be ultra-efficient (no PHP/Apache overhead). To improve things further, it would be good if the 1P4 clients ••intelligently•• used their vuln.sqlite on their local system, with a new "last-tested-at" timestamp AND a "vulnerability certainty", to determine which sites their clients no longer need to submit since they've already been definitively tested. This would further lessen the load on the server.

    I was both lazy and a programmer so I wrote the PHP script above to do all of the test-submissions for me... Other people are not so lucky, unfortunately. ;)

    Did you do this while you were in a secondary vault? We're tracking down a bug where if you're in a secondary vault, it will not create the file.
    If you were in the primary vault, it does work for me. Even on a fresh install that never had this feature enabled before and thus the file was never created before.

    Nope.

    My vault was created in 1P 4.2-BETAsomething as a blank, new vault. I then imported my 1PIF file from 1P3 into that vault. Not sure if this info helps.

    I have no extra vaults. Just one main vault.

    The latest time that my "3rd party integration" file was successfully created from scratch on this system was back after I had freshly installed Mavericks and 1P4 on this laptop about 2 months ago. You were in the 4.2-BETA series at the time. I enabled "3rd party integration" after installing and the file was created. So it worked back then.

    So yeah... the bug can obviously affect main vaults too and occurred somewhere between 4.2 and 4.4... not sure how helpful this info is.

    It makes no sense to me that the file cannot be created, but that it will be maintained as long as it already exists, because that reveals that 1P4 knows the exact filesystem-path to use but yet it can't create the file itself... Sandboxing issue? File-creation permissions issue?

  • buggypac
    buggypac
    Community Member
    edited May 2014
    Options

    Hmm. On "Sunday, May 4, 2014 at 12:41 AM" the file was finally created. That's THREE DAYS after I enabled the checkbox for "3rd party integration".

    There have not been any reboots in the meantime that I can remember, but there has been laptop sleep/hibernate, if that helps you figure this out.

    To me it seems the bug might be that the data is not written to disk immediately as soon as the "enable 3rd party integration" checkbox is enabled, nor as soon as data is edited (I tried that on May 1st and it didn't work).

    If I were you I would look over the various locations where the 3rd party file write/update-call is performed, and most importantly make sure it is done as soon as the "enable 3rd party integration" checkbox is checked.

    Suggested times to create/update the file:

    • When 3rd party integration is enabled.
    • When the URL or title of any login is changed (as the 3rd party file contains title, URL and login-ID).
    • When a login is created or deleted.
  • buggypac
    buggypac
    Community Member
    Options

    @MikeT Tagging since my report about May 4th may be useful to you.

  • MikeT
    Options

    Hi @buggypac,

    Okay. The unfortunate thing is that Watchtower isn't very effective against Heartbleed without an auto-submission feature. It's very misleading to have a "Watchtower" section that supposedly gives users vulnerability-info for their sites, without telling them that most of their sites aren't even tested (unless they manually type them in on the watchtower website) and therefore won't be listed. The current system also suffers from stale results, due to someone perhaps testing a site 14 days ago and then never again, which means that everybody with that particular site in their DB might see it as "vulnerable" when it no longer is, or whatever.

    We're not relying on a single source of data, we're getting lists of sites from other sources as well, including a list of sites known not to be vulnerable. We're not relying on our customers alone and we are looking into additional sources to run tests on.

    As I mentioned, nothing is finalized yet.

    HTTPS with the valid certificate signature built into the app to prevent impersonation. Make a server that sits behind Cloudflare (which won't log the customer's HTTPS POST submissions) and have a back-end script that likewise doesn't log the request or the originating IP, just the list of domains. This will be anonymous, since your server will only see the Cloudflare IPs in your access logs (since the actual, real customer IP is in an extra "proxy" header by Cloudflare, See:

    That's actually the basic summary of how our Rich Icons work. Rich Icons might be a good source for us to grab the list of domains as well. :)

    Hmm. On "Sunday, May 4, 2014 at 12:41 AM" the file was finally created. That's THREE DAYS after I enabled the checkbox for "3rd party integration".

    That really doesn't make any sense. We're not waiting for anything when creating the file, it is told to created it as soon as the checkbox is enabled.

    Just out of curiosity, did you see anything out of the norms in the Console? Any sandboxing issues to that path or anything like that?

  • buggypac
    buggypac
    Community Member
    edited May 2014
    Options

    @MikeT‌

    The only good news is that I am able to reproduce this bug with 100% success.

    • Opened Console and cleared the log.
    • Launched 1Password and unlocked it.
    • Cleared the log.
    • Opened 1Password Preferences and unchecked "3rd party integration" and the bookmarks-default.json file vanished (but not the 3rd party integration folder).
    • Nothing showed up in Console.
    • Enabled "3rd party integration" and of course bookmarks-default.json did not appear.
    • Nothing showed up in Console.
    • I checked permissions on all folders under ~/Library/Application Support/1Password 4 and see that they are all owned by MyUsername:staff and all have read/write/execute access (as expected for folders).
    • If I wait a few days bookmarks-default.json will probably show up again, like last time.

    I am on Mavericks 10.9.2, fully up-to-date, and see this exact failed behavior on both a MacBook Pro 2010 and a Mac Pro 2012 (running the same OS version). Both are running the absolutely latest 1Password 4.4.1.BETA-1, but this bug appeared a few versions ago and went unnoticed by me since I wasn't fiddling with the "enable/disable 3rd party integration" checkbox back then.

    Are you guys not seeing this at all? I see it across multiple machines. :/

    Did uncover one small bug for you (attempting to draw something on a non-initialized context), as I saw this message immediately after unlocking:

    5/10/14 3:36:56.236 PM 1Password 4[18372]: It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil. This is a programming error. Break on void _NSWarnForDrawingImageWithNoCurrentContext() to debug. This will be logged only once. This may break in the future.

  • Megan
    Megan
    1Password Alumni
    Options

    Hi @buggypac‌

    Thanks so much for the detailed report! We've been able to recreate this on our end, and we've filed a report in our internal issue tracker. We'll do what we can to have this behaving properly for you soon.

    .

  • buggypac
    buggypac
    Community Member
    Options

    @Megan That's the best news I've heard since inventing a time machine, traveling back in time and telling myself some good news! In other words, that's some good news you're bringing there!

  • Megan
    Megan
    1Password Alumni
    Options

    Hi @buggypac‌

    So glad to hear it! As a reward, I'd be happy to accept a brush from Van Gogh's studio ... or a pre-pre-release version of the 7th generation iPad. ;)

  • AGKyle
    AGKyle
    1Password Alumni
    edited May 2014
    Options

    Hi @buggypac‌,

    This should be resolved in the next update, and maybe even in the next beta if you're running the betas.

    Let us know if there is anything else we can help you with! Have a wonderful week.

  • buggypac
    buggypac
    Community Member
    Options

    4.4.1-BETA4:

    Fixed problem where the integration with 3rd party apps couldn't re-enabled if previously disabled.

    Thanks! It works and now creates the file instantly whenever I check/uncheck the box.

    Take care :)

  • Megan
    Megan
    1Password Alumni
    Options

    Hi @buggypac,

    Thanks so much for letting us know that this works for you! On behalf of @AGKyle‌, we're glad to have been able to help.

    We're here if you have any further questions or concerns. :)

This discussion has been closed.