Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

User input validation.

smicallefa073ff94259f
diff --git a/sfwebui.py b/sfwebui.py
index fafe29be..2f7d0d6e 100644
--- a/sfwebui.py
+++ b/sfwebui.py
@@ -37,6 +37,15 @@ class SpiderFootWebUi:
sf = SpiderFoot(config)
self.config = sf.configUnserialize(dbh.configGet(), config)
+ # Sanitize user input
+ def cleanUserInput(self, inputList):
+ ret = list()
+
+ for item in inputList:
+ ret.append(cgi.escape(item))
+
+ return ret
+
#
# USER INTERFACE PAGES
#
@@ -106,12 +115,6 @@ class SpiderFootWebUi:
return templ.render(pageid='SCANLIST')
index.exposed = True
- # Include this in case the user is clicking reload after creating
- # the DB and restarting.
- def create(self):
- return self.index()
- create.exposed = True
-
# Information about a selected scan
def scaninfo(self, id):
dbh = SpiderFootDb(self.config)
@@ -178,6 +181,8 @@ class SpiderFootWebUi:
def startscan(self, scanname, scantarget, modulelist):
modopts = dict() # Not used yet as module options are set globally
+ [scanname, scantarget] = self.cleanUserInput([scanname, scantarget])
+
if scanname == "" or scantarget == "" or modulelist == "":
return self.error("Form incomplete.")