Skip to content

Conversation

@AspHyxia28
Copy link

Fix: Gracefully handle errors in wifiConfigstore2 and gboard parsers

Summary

Improves robustness of artifact parsers by adding proper error handling for missing data and corrupted files.

Changes

wifiConfigstore2.py

  • Initialize all 14 data variables to empty strings before XML processing
  • Prevents UnboundLocalError when XML fields are missing from the data structure
  • Allows parser to complete successfully with incomplete WiFi configuration data

gboard.py

  • Import DecodeError from google.protobuf.message
  • Wrap protobuf decoding logic in try-except block to catch and skip malformed data
  • Skip individual rows with corrupted protobuf messages instead of crashing entire artifact
  • Log skipped rows for debugging and transparency

Testing

Both parsers now complete successfully when encountering:

  • Missing or incomplete data fields
  • Corrupted protobuf messages
  • Malformed file structures

Valid data is still extracted and reported, with errors logged appropriately.

Related Issues

  • Fixes crash on incomplete WiFi configuration files
  • Fixes crash on Gboard files with corrupted keystroke data

This is tested on Android Forensic Image Version 11 from https://thebinaryhick.blog/public_images/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant