Spend some time type-checking - no exploitable vulns we are aware of, but no reason to leave it to future chance

unstable
HD Moore 2012-02-07 17:16:57 -06:00
parent 272591b3d3
commit 6685a65c39
3 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,10 @@ end
def rpc_login_noauth(user,pass)
if not (user.kind_of?(::String) and pass.kind_of?(::String))
error(401, "Login Failed")
end
# handle authentication here
fail = true
self.users.each do |u|

View File

@ -198,6 +198,11 @@ class Service
def authenticate(token)
stale = []
if not (token and token.kind_of?(::String))
return false
end
# Force the encoding to ASCII-8BIT
token = token.unpack("C*").pack("C*")

View File

@ -199,7 +199,7 @@ module Parser
return unless @report_type_ok
unless @state[:current_tag].empty?
missing_ends = @state[:current_tag].keys.map {|x| "'#{x}'"}.join(", ")
msg = "Warning, the provided file is incomplete, and there may be missing\n"
l msg = "Warning, the provided file is incomplete, and there may be missing\n"
msg << "data. The following tags were not closed: #{missing_ends}."
db.emit(:warning,msg,&block) if block
end