The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Flush Preferences

Wyatt | Last updated: May 22, 2023 06:21PM UTC

Hi PortSwigger Team, I'm seeing some odd behavior with both the extensionData and preferences objects in Montoya. I've written an extension that tries to store settings that will persist after reloading the extension or restarting Burp. Unfortunately, I'm seeing data persist even when it's been updated or cleared out. My guess is that Montoya isn't flushing or syncing the preferences data before my extension is unloaded. The setting is correct in memory, however it loads the wrong value when I restart the extension. The flow looks like this: 1. Check if the value exists, with api.persistence().preferences().getString("key") 2. If the value is null or an empty string, set it to some default: api.persistence().preferences().setString("key", "default") 3. Verify the new value was set: api.logging.logToOutput(api.persistence().preferences().getString("key")) 4. Enter text into a textbox and click a button to update the preference: api.persistence().preferences().setString("key", "new value") 5. Verify the new value was set: api.logging.logToOutput(api.persistence().preferences().getString("key")) Upon reloading the extension, I'm seeing the value of "default" set to "key", instead of "new value". For the duration of time that the extension is loaded, the value is "new value", but when I reload it it fails to acknowledge the new value. I've checked to ensure there isn't other code that is setting the preference. What's the best way I can go about troubleshooting this? I'm observing this behavior on 2023.4.4 with community and pro versions across different operating systems.

Hannah, PortSwigger Agent | Last updated: May 25, 2023 04:10PM UTC

Hi Wyatt Unfortunately, we're not able to replicate this issue. Do you find that this only happens when updating the "key" value through a Swing interface? Could you drop us an email at support@portswiggernet with a working POC of this issue, please?

Wyatt | Last updated: Aug 05, 2023 09:37PM UTC

Following up on this post if others run into this: Re-writing the extension into a new project seemed to resolve the issue. I'm not sure if this was from trying to upgrade an old project to use Montoya.

Hannah, PortSwigger Agent | Last updated: Aug 07, 2023 08:46AM UTC