Is it possible to get a virus from malicious sensors or modules?

Title///////////////

No.

I've moved your topic to general discussion as it seemed more appropriate than general electronics.

Please post a link to the malicious sensor or module. Instead of pointing to the title, you should fully explain the "back story" or reason for this question.

not if you did not lower your USB security and do not download weird stuff from untrusted sources over the internet (like device driver) to get your module to work

I'm speaking generally

Then no. Viruses typically can only survive a few minutes outside of a host.

Is it likely? No. Is it possible? I think so.

If you know how the sensor is likely to be used (vulnerable OS or platform), it may be possible to have the sensor send actual executable code instead of its "sensed data" and in combination with a buffer overflow, cause that code to be executed. It's a long shot and I am by far not a security expert, but I think it's possible. I've heard of stranger exploits.

A better question would be why someone wants to do this and what asset they would gain access to by doing it?

No but yes.

AVR microcontrollers are Harvard arquitecture. This means instructions and data have separate address space. A side effect of this is that all reads from peripherals are to be placed into the later, without any oportunity to alter code or place any kind of daemon.

There is, however an application instance that breaks instruction and data separation: interpreters. If an interpreter was created in AVR, the core of the application would be in the instruction memory, but the program per se would be placed into the data space. In this specific case, nothing prevents a malicious or accidental, harmful code, from being read by the AVR and executed by the interpreter.

If you find a USB stick on the street, it is not a good idea to plug it in to your computer :wink:

For Arduino'ish sensors, No.

For Arduino modules, As those purchased off AliExpress, 3rd-party Amazon, Banggood, DHgate, GearBest, and many more...
Modules may have significant flash storage, native USB, and "potentially" the ability to infect a PC hosting the USB ... this is doubly true if a custom driver must be installed for the USB.

Please show an example of "interpreter", which can run an AVR controllers -Uno, Nano, Mega

Sorry, man, but here you go
https://projecthub.arduino.cc/sl001/5d7bbcfa-552c-4da9-93e5-8ea6556318d4

thank you

so can we talk about that?

If you want to go off topic...

lol. I dont really want to mess up the forum.

It's not a good time to stir up things.

I don't know the AVR scene enough, although there is a large diversity of examples working with other microarchitectures. Actually, Microsoft very first product was Altair Basic. My piece of advice for you would be to study a bit of something called "history".

And yes, in this case it would break the Harvard model simply because the program being executed on top of the interpreter needs to be placed in ram in order to be created, loaded or edited. As a result, the interpreter instructions (or commands if you prefer to call them) and processed data would be in the same memory space.

At this point, I don't see why some sensor/peripheral/shield/anything-else could not ruin someone's day.

directed to @b707 or to @mrburnette ?

I think to me...
But I'm not too interested in interpreters. Microcontrollers are primarily programmed in C.