'Sending logs with bug reports: how to defend against easy exploits like malicious file enlargement?

When a crash occurs or when a user reports a bug, I'd like to send my application's logs to a cloud service (Firebase).

But I've just realised that there are tons of kindergarten level exploits. For example:

  • they can make these logs tremendous sized, causing me huge bills.

Some examples:

    1. If the log are accessible/unauthenticated then it's trivial.
    1. If the logs are i.e. signed by the application somehow... they can still generate huge ones by just using the application.

I thought about limiting the file size by removing lines from the logs by some prioritizing until they are below the size limit.

  • But then debugging can be a magical beast, there is a chance that we've just deleted a seemingly unimportant, yet now important line.

And then let's say I implemented some fine logic to keep it under a size limit.

  • The user can still send reports an unlimited amount of time.

I guess I could add some IP limiting, but that could harm the good users by not letting them send more than 6 bug reports / hour.

My application won't be a hit, so I guess I should just prepare for the script kiddies.

But even so, my question is: What should I be aware of? Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source