47306d
diff --git a/src/lxml/html/defs.py b/src/lxml/html/defs.py
47306d
index caf6b21..ea3c016 100644
47306d
--- a/src/lxml/html/defs.py
47306d
+++ b/src/lxml/html/defs.py
47306d
@@ -21,6 +21,8 @@ link_attrs = frozenset([
47306d
     'usemap',
47306d
     # Not standard:
47306d
     'dynsrc', 'lowsrc',
47306d
+    # HTML5 formaction
47306d
+    'formaction'
47306d
     ])
47306d
 
47306d
 # Not in the HTML 4 spec:
47306d
diff --git a/src/lxml/html/tests/test_clean.py b/src/lxml/html/tests/test_clean.py
47306d
index 451eec2..e40cdad 100644
47306d
--- a/src/lxml/html/tests/test_clean.py
47306d
+++ b/src/lxml/html/tests/test_clean.py
47306d
@@ -89,6 +89,21 @@ class CleanerTest(unittest.TestCase):
47306d
             b'<math><style>/* deleted */</style></math>',
47306d
             lxml.html.tostring(clean_html(s)))
47306d
 
47306d
+    def test_formaction_attribute_in_button_input(self):
47306d
+        # The formaction attribute overrides the form's action and should be
47306d
+        # treated as a malicious link attribute
47306d
+        html = ('<form id="test"><input type="submit" formaction="javascript:alert(1)"></form>'
47306d
+        '<button form="test" formaction="javascript:alert(1)">X</button>')
47306d
+        expected = ('
<form id="test"><input type="submit" formaction=""></form>'
47306d
+        '<button form="test" formaction="">X</button>')
47306d
+        cleaner = Cleaner(
47306d
+            forms=False,
47306d
+            safe_attrs_only=False,
47306d
+        )
47306d
+        self.assertEqual(
47306d
+            expected,
47306d
+            cleaner.clean_html(html))
47306d
+
47306d
 
47306d
 def test_suite():
47306d
     suite = unittest.TestSuite()