7.3 Discovering Security Issues

Description

TYPO3 CD 2020 (zweite Auflage) Quiz on 7.3 Discovering Security Issues, created by Pascal Bartl on 09/04/2021.
Pascal Bartl
Quiz by Pascal Bartl, updated more than 1 year ago
Pascal Bartl
Created by Pascal Bartl over 3 years ago
0
0

Resource summary

Question 1

Question
What 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'; } ... }
Answer
  • The method call should read getArgument('template')
  • The hasArgument() function should be used to check whether the argument exists
  • The require function should be used, rather than include
  • A “path traversal” can be injected via the GET/POST argument
  • Extbase should check whether the file exists before including it

Question 2

Question
Which 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); }
Answer
  • The method execute() does not accept a parameter
  • The parameter of method statement() can not be a native SQL query
  • The code shows a possible SQL injection vulnerability
  • The code is perfectly fine
  • Method names in repository classes must not start with selectBy
Show full summary Hide full summary

Similar

Unit 1 Sociology: Family Types
ArcticCourtney
Girls' and Boys' Education - A Mind Map
Cecelia Price
Fundamentals in Chemistry
kate.siena
Dier (Onderdeel plant&dier toets)
samanthabirdsall
Anatomy and Physiology - BIO 111 - Test #1 Flashcards
ajudkins
GCSE AQA Biology - Unit 1
James Jolliffe
GCSE REVISION TIMETABLE
Sophie Thuita
Tips for Succeeding on the Day of the Exam
Jonathan Moore
PSBD New Edition
Aafnai Sathi
A Christmas Carol (Key Quotes)
Samira Choudhury
Core 1.5 Mechanisms
T Andrews