Security vendors have warned of a flaw that affects an unusually broad cross-section of browsers - Internet Explorer, Firefox and the Mozilla suite on Windows, Linux and Mac OS X - and could be used to hoover up files from vulnerable systems.

The problem is in the way the browsers implement scripting - JavaScript in Firefox and Active Scripting in IE. Both browsers have a design error in which a script can cancel certain keystroke events when users are entering text.

The bug could be exploited into tricking users into entering text into a field that seems secure, while in fact the text is being made accessible to an attacker. "In both IE and Firefox you can filter the keystrokes entered in a form and 'bounce' the input over to the file input box, and then bounce back to previous text entry, making it appear as if nothing has happened," said Charles McAuley, who originally discovered the flaw, in an advisory published on Monday.

Using this technique, attackers could obtain the directory path of sensitive files, which could then be uploaded to the attacker, according to several advisories.

"This flaw... could be exploited by remote attackers to trick users into uploading arbitrary files from a vulnerable system to a malicious host by convincing them to visit a specially crafted web page and perform certain actions (eg write a specific text in a text field) that will cause an arbitrary file to be inadvertently uploaded," said FrSIRT in an advisory on Tuesday.

McAuley published proof-of-concept code showing that the bug is exploitable. He said that Microsoft showed no interest in patching the bug; Firefox also remains unpatched. A similar bug was reported in Firefox in 2000, according to McAuley.

The good news is that the flaw is rather tricky to exploit, security vendors said. Symantec said typing-intensive applications such as keyboard-based games, blogs and the like are likely to be targeted. "Exploiting this issue requires that users manually type the full path of files that attackers wish to download…[and] may require substantial typing from targeted users," Symantec said.

The bug affects current versions of Firefox and Mozilla, as well as the Mozilla successor, SeaMonkey, as well as IE versions up to IE 7 Beta 2, according to researchers.