Is there any way to detect injection into unencrypted http traffic, like files, js etc.
a. just by traffic analysis
b. from the client-side?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
Sign up to join this communitya) 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.