← DevLog

2 min read

The integration that could do everything

A marketing integration on a production shop had full admin access through a token that never expires. It had not synced anything in at least a month. Nobody noticed either.

Someone mentioned in passing that the email marketing integration on a production shop had access to everything. That turned out to be literally true. In Magento's integration settings it had full admin rights: every customer, every order, every price, every setting. A second integration from the same vendor had 166 separate permissions.

A token that never expires

A Magento integration gets an access token when it is activated. That token does not expire. On this shop, a setting allowed integration tokens to be used as ordinary bearer tokens, so anyone holding one could call the full REST API with it. The rights of the integration are the rights of the token, forever, until somebody revokes it.

And it was not even working

Before switching it off I checked what it was doing. The vendor's servers were calling the shop about 450 times a day, and every one of those calls got a 401 or a 404. For the whole 30 days the logs covered. The module that made the integration work had been removed from the code a long time ago. The integration stayed behind, with its rights.

So a dead sync was polling a production shop hundreds of times a day, with full admin rights it could not use, and nobody had noticed for at least a month.

What we did

  • Deactivated both integrations and revoked their tokens, plus three older tokens nobody was using.

  • Kept a record of the previous state, so it can be switched back on in a minute if anything turns out to depend on it.

  • Left the bearer setting alone for now, until we know which integrations rely on it.

The calls still arrive and still get a 401. That is expected now, and harmless.

Check yours

In the Magento admin, go to System, Extensions, Integrations. For each one, ask three questions:

  • Is it still in use? Check your web server logs for its requests and for the response codes it gets.

  • Does it need what it has? An email tool needs customers and newsletter subscriptions. It does not need to change prices or create admin users.

  • Who would notice if its token leaked? If the answer is nobody, it should not have full access.

This takes ten minutes. Every integration you remove or narrow down is one less key to your whole shop sitting with a vendor.