Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
712e3a8e
Commit
712e3a8e
authored
Nov 07, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API Fuzzing responses
* Add sent and response fields
parent
153a0527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
38 deletions
+83
-38
ee/app/assets/javascripts/vulnerabilities/components/details.vue
...assets/javascripts/vulnerabilities/components/details.vue
+83
-38
No files found.
ee/app/assets/javascripts/vulnerabilities/components/details.vue
View file @
712e3a8e
...
@@ -53,25 +53,43 @@ export default {
...
@@ -53,25 +53,43 @@ export default {
properties
:
{},
properties
:
{},
};
};
},
},
getConstructedRequest
()
{
const
{
body
,
method
,
url
,
headers
=
[]
}
=
this
.
vulnerability
.
request
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
[
`
${
method
}
${
url
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
);
},
getConstructedResponse
()
{
const
{
body
,
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[],
}
=
this
.
vulnerability
.
response
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
[
`
${
reasonPhrase
}
${
statusCode
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
);
},
getConstructedRecordedResponse
()
{
const
{
body
,
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[],
}
=
this
.
vulnerability
.
supporting_messages
[
1
].
response
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
[
`
${
reasonPhrase
}
${
statusCode
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
);
},
requestData
()
{
requestData
()
{
if
(
!
this
.
vulnerability
.
request
)
{
if
(
!
this
.
vulnerability
.
request
)
{
return
[];
return
[];
}
}
const
{
method
,
url
,
headers
=
[]
}
=
this
.
vulnerability
.
request
;
return
[
return
[
{
{
label
:
__
(
'
%{labelStart}Method:%{labelEnd} %{method}
'
),
label
:
__
(
'
%{labelStart}Sent request:%{labelEnd} %{headers}
'
),
content
:
method
,
content
:
this
.
getConstructedRequest
,
},
{
label
:
__
(
'
%{labelStart}URL:%{labelEnd} %{url}
'
),
content
:
url
,
},
{
label
:
__
(
'
%{labelStart}Headers:%{labelEnd} %{headers}
'
),
content
:
this
.
getHeadersAsCodeBlockLines
(
headers
),
isCode
:
true
,
isCode
:
true
,
},
},
].
filter
(
x
=>
x
.
content
);
].
filter
(
x
=>
x
.
content
);
...
@@ -81,20 +99,23 @@ export default {
...
@@ -81,20 +99,23 @@ export default {
return
[];
return
[];
}
}
const
{
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[],
}
=
this
.
vulnerability
.
response
;
return
[
return
[
{
{
label
:
__
(
'
%{labelStart}Status:%{labelEnd} %{status}
'
),
label
:
__
(
'
%{labelStart}Actual response:%{labelEnd} %{headers}
'
),
content
:
statusCode
&&
reasonPhrase
?
`
${
statusCode
}
${
reasonPhrase
}
`
:
''
,
content
:
this
.
getConstructedResponse
,
isCode
:
true
,
},
},
].
filter
(
x
=>
x
.
content
);
},
recordedResponseData
()
{
if
(
!
this
.
vulnerability
.
supporting_messages
[
1
].
response
)
{
return
[];
}
return
[
{
{
label
:
__
(
'
%{labelStart}
Headers:
%{labelEnd} %{headers}
'
),
label
:
__
(
'
%{labelStart}
Unmodified Response
%{labelEnd} %{headers}
'
),
content
:
this
.
get
HeadersAsCodeBlockLines
(
headers
)
,
content
:
this
.
get
ConstructedRecordedResponse
,
isCode
:
true
,
isCode
:
true
,
},
},
].
filter
(
x
=>
x
.
content
);
].
filter
(
x
=>
x
.
content
);
...
@@ -248,7 +269,7 @@ export default {
...
@@ -248,7 +269,7 @@ export default {
</
template
>
</
template
>
<section
v-if=
"requestData.length"
data-testid=
"request"
>
<section
v-if=
"requestData.length"
data-testid=
"request"
>
<h3>
{{ s__('Vulnerability|Request') }}
</h3>
<h3>
{{ s__('Vulnerability|Request
/Response
') }}
</h3>
<ul>
<ul>
<detail-item
<detail-item
v-for=
"({ label, isCode, content }, index) in requestData"
v-for=
"({ label, isCode, content }, index) in requestData"
...
@@ -263,20 +284,44 @@ export default {
...
@@ -263,20 +284,44 @@ export default {
</ul>
</ul>
</section>
</section>
<section
v-if=
"responseData.length"
data-testid=
"response"
>
<div
v-if=
"responseData.length || recordedResponseData.length"
class=
"row"
>
<h3>
{{ s__('Vulnerability|Response') }}
</h3>
<section
<ul>
v-if=
"responseData.length"
<detail-item
:class=
"recordedResponseData.length ? 'col-6' : 'col'"
v-for=
"({ label, isCode, content }, index) in responseData"
data-testid=
"response"
:key=
"`${index}:${label}`"
>
:sprintf-message=
"label"
<ul>
>
<detail-item
<code-block
v-if=
"isCode"
class=
"mt-1"
:code=
"content"
max-height=
"225px"
/>
v-for=
"({ label, isCode, content }, index) in responseData"
<
template
v-else
>
:key=
"`${index}:${label}`"
{{
content
}}
:sprintf-message=
"label"
</
template
>
>
</detail-item>
<code-block
v-if=
"isCode"
class=
"mt-1"
:code=
"content"
max-height=
"225px"
/>
</ul>
<
template
v-else
>
</section>
{{
content
}}
</
template
>
</detail-item>
</ul>
</section>
<section
v-if=
"recordedResponseData.length"
:class=
"responseData.length ? 'col-6' : 'col'"
data-testid=
"response"
>
<ul>
<detail-item
v-for=
"({ label, isCode, content }, index) in recordedResponseData"
:key=
"`${index}:${label}`"
:sprintf-message=
"label"
>
<code-block
v-if=
"isCode"
class=
"mt-1"
:code=
"content"
max-height=
"225px"
/>
<
template
v-else
>
{{
content
}}
</
template
>
</detail-item>
</ul>
</section>
</div>
</div>
</div>
</template>
</template>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment