Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CookieAnalyzer extends Analyzer {
}

_checkOCE (context, value) {
if (value && value.location) {
if (value?.location) {
return true
}
return super._checkOCE(context, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SSRFAnalyzer extends InjectionAnalyzer {
this.addSub('apm:http:client:request:start', ({ args }) => {
if (typeof args.originalUrl === 'string') {
this.analyze(args.originalUrl)
} else if (args.options && args.options.host) {
} else if (args.options?.host) {
this.analyze(args.options.host)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UnvalidatedRedirectAnalyzer extends InjectionAnalyzer {
}

isLocationHeader (name) {
return name && name.trim().toLowerCase() === 'location'
return name?.trim().toLowerCase() === 'location'
}

_isVulnerable (value, iastContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function extractSensitiveRanges (evidence) {
pattern.lastIndex = 0

const regexResult = pattern.exec(evidence.value)
if (regexResult && regexResult.length > 1) {
if (regexResult?.length > 1) {
const start = regexResult.index + (regexResult[0].length - regexResult[1].length)
const end = start + regexResult[1].length
return [{ start, end }]
Expand Down
Loading