Quiz
7.3 Discovering Security Issues
Perguntas do quiz (2)
1What is wrong with the following code? (1)
public function showAction() {
$arguments = $this->request->getArguments();
$template = $arguments['template'];
if ($template) {
include $template . '.php';
} else {
include 'default_template.php';
}
...
}- AThe method call should read getArgument('template')
- BThe hasArgument() function should be used to check whether the argument exists
- CThe require function should be used, rather than include
- DA “path traversal” can be injected via the GET/POST argument
- EExtbase should check whether the file exists before including it
2Which statement about the following code in an Extbase repository is correct? (1)
public function selectByPid($pid) {
$query = $this->createQuery();
$select = "SELECT uid FROM table WHERE pid = " . $pid;
return $query->statement($select)->execute(true);
}- AThe method execute() does not accept a parameter
- BThe parameter of method statement() can not be a native SQL query
- CThe code shows a possible SQL injection vulnerability
- DThe code is perfectly fine
- EMethod names in repository classes must not start with selectBy
Informações
- Descrição
- O usuário eliminou as informações de disciplina Quiz sobre 7.3 Discovering Security Issues, criado por Usuário eliminado em 27-04-2022.
- Autor
- Usuário eliminado
- Idioma
- English
- Visualizações
- 18
- Histórico
- Criado em 27 abr 2022 · atualizado em 27 abr 2022
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz