The legal advice is the latest battle in the Dieselgate scandal, where some of VW's cars were polluting more than the accepted limit.
The European Union's top court has all but confirmed that so-called defeat devices, used to trick emissions tests in cars, are contrary to EU law.
The development comes in a legal opinion in a case against Volkswagen and Porsche on Thursday from Advocate General Athanasios Rantos, who said that "the software at issue reduces the effectiveness of the emission control system in normal vehicle operation and use, with the result that it constitutes a ‘defeat device.'"
It is the latest battle in the Dieselgate scandal, where some of VW's cars were polluting more than the accepted limit.
Despite the fresh setback for the German car manufacturer, Georg Riekeles, Associate Director at the European Policy Centre, says the industry still remains highly influential.
"In short, what I would say is that maybe not enough has changed, and that the car lobby remains extremely strong as seen in the latest rounds of proposing regulation," Riekeles told Euronews.
Last year, the European Court of Justice ruled that consumers can sue in the country where they bought Volkswagen vehicles fitted with emissions-cheating devices.
The German car giant admitted to cheating diesel emission tests in the US after it was claimed some Volkswagen cars were being sold with a "defeat device", or software, which can detect when a test is being carried out and adjust its performance accordingly.
The legal opinion, which also says that the software cannot be justified as a way to protect car engines, is not binding on Europe’s top court, but in most cases, it follows such advice.