Hi,
I have just fixed a tailgate rattle on my 2014 CX5, took me some time to locate the problem so I thought I would share it. The sound is like a box of tools rattling in the boot when going over small bumps or an uneven surface. After searching this forum to no avail I found a US thread about the external plastic moulding above the rear window - they call it the 'spoiler'. For some reason the fixing bolts, underneath two rubber grommets on the inside on either side of the tailgate, work loose. I found one of mine was missing completely. so replaced it and the rattle got better but didn't go away completely. I then noticed the two external plastic mouldings to either side of the spoiler were also loose, but appeared to be fixed to the spoiler and could only be investigated by removing the spoiler altogether. This wasn't possible as it looks like a special tool is required to release the spoiler's nylon snap fixings, otherwise they will break when levered off. So, I simply put some foam rubber underneath the lower pointed end of each moulding between it and the glass, and now its solid and quiet! Not sure if the 2017 model has the same design spoiler but worth checking out!