I wanted to ask a question around the usage of XID, and notably truncating it on the client side for clients which configure shorter correlation ID's:
|
correlationID = xid.New().String() |
|
if len(correlationID) > options.CorrelationIdLength { |
|
correlationID = correlationID[:options.CorrelationIdLength] |
|
} |
Because XID is structured ([4B timestamp][3B machine ID][2B PID][3B counter]) truncating like this changes the correlation id behavior, and changes what usages may be more likely to conflict (the second resolution timestamp prefix is the primary protection today when truncating).
I also wondered why XID was chosen generally. The sorting from timestamp has some value, but the machine correlation seems like a slight privacy concern (ability to correlate to creating system).
I suggest we transition to either only a timestamp prefixed value (followed by random), or a completely random value (both of which would be safe to truncate). But I wanted to file an issue and ask around the motivation around XID first before submitting a PR. Thank you!
I wanted to ask a question around the usage of XID, and notably truncating it on the client side for clients which configure shorter correlation ID's:
interactsh/pkg/client/client.go
Lines 154 to 157 in 810180a
Because XID is structured (
[4B timestamp][3B machine ID][2B PID][3B counter]) truncating like this changes the correlation id behavior, and changes what usages may be more likely to conflict (the second resolution timestamp prefix is the primary protection today when truncating).I also wondered why XID was chosen generally. The sorting from timestamp has some value, but the machine correlation seems like a slight privacy concern (ability to correlate to creating system).
I suggest we transition to either only a timestamp prefixed value (followed by random), or a completely random value (both of which would be safe to truncate). But I wanted to file an issue and ask around the motivation around XID first before submitting a PR. Thank you!