Skip to content

Commit

Permalink
Add request path param as a source of vulnerability values
Browse files Browse the repository at this point in the history
  • Loading branch information
nchervyakov committed Feb 9, 2015
1 parent 2028b15 commit 6cfc6bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions classes/App/Core/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public function cookieWrap($key = null, $default = null)
return $this->getWrappedValueOrArray(FieldDescriptor::SOURCE_COOKIE, $key, $default);
}

public function paramWrap($key = null, $default = null)
{
return $this->getWrappedValueOrArray(FieldDescriptor::SOURCE_PARAM, $key, $default);
}

public function headerWrap($key = null, $default = null)
{
return $this->getWrappedValueOrArray(FieldDescriptor::SOURCE_HEADER, $key, $default);
Expand Down Expand Up @@ -195,6 +200,9 @@ public function getRawValue($source, $key = null, $default = null, $arr = null)
} else if ($source == FieldDescriptor::SOURCE_HEADER) {
$raw = $this->header($key, $default);

} else if ($source == FieldDescriptor::SOURCE_PARAM) {
$raw = $this->param($key, $default);

} else {
$raw = $default;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ class FieldDescriptor
{
const SOURCE_ANY = 'any';
const SOURCE_QUERY = 'query';
const SOURCE_PARAM = 'param';
const SOURCE_BODY = 'body';
const SOURCE_HEADER = 'header';
const SOURCE_COOKIE = 'cookie';

protected static $sources = [
self::SOURCE_ANY,
self::SOURCE_QUERY,
self::SOURCE_PARAM,
self::SOURCE_BODY,
self::SOURCE_HEADER,
self::SOURCE_COOKIE,
Expand Down

0 comments on commit 6cfc6bb

Please sign in to comment.