Is there any way to detect injection into unencrypted http traffic, like files, js etc.
- just by traffic analysis
- from the client-side?
Is there any way to detect injection into unencrypted http traffic, like files, js etc.
a) If by "just ..." you mean without any extra flags, clues, etc. from on each side of an HTTP connection, or knowing their history, ordinary traffic and normal behavior, the answer is No.
b) Yes & No! It depends.
No, if it's ordinary innocent traffic without any additional clues to help one party (the client, in your case) check out if something has already been stuffed into the traffic, or it's been tampered with.
Yes, If some extra [hidden] meta data (like a checksum with customized algorithm) has been added so it can be used on the other side of the deal or en route, to verify the integrity of the whole thing, e.g. using piece of javascript code on the page or manual inspection.