Value with aad column in settings table

I often restore the backup of a customer’s metabase database in my dev environment and then just edit a few settings to make it run here. Mostly just the name and the SMTP settings as I don’t want to cause confusion.

A new column has appeared in the settings table called ‘value_with_aad’.

What’s that for?

Its an authenticated and encrypted version of the setting value. Its there to defeat hacks on encrypted settings by writing a value to another setting and swapping the encrypted value in the database.

From the migration that introduces it:

Add setting.value_with_aad, which stores a setting's value encrypted under additional authenticated data naming the setting (setting.), so that a value moved between rows fails to decrypt: the bare value in setting.value, or its ciphertext, says nothing about which setting it belongs to, and a direct DB write could give one setting another's value. value is kept: this version writes both columns and reads only value_with_aad, so a version that predates the column keeps working through a rolling upgrade, and a rollback is just dropping value_with_aad again. The column is filled in from value after migrations, by metabase.app-db.setting/migrate-settings!, which also repairs rows such a version has written since.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.