Last updated: January 30, 2026
Sofi Baby ("we", "our", "the app") is a baby tracking application. This policy explains how we collect, use, and protect your information.
The is a mock Gist for the working with APIs lesson.
Cross-site Scripting (XSS) is a client-side code injection attack. The attacker aims to execute malicious scripts in a web browser of the victim by including malicious code in a legitimate web page or web application. When a user visit the infected or a specially-crafted link , it will execute the malicious javascript.
Famous attacks:
What can we do with XSS:
| def spin_me(arr) | |
| arr.each do |word| | |
| word.reverse! | |
| end | |
| end | |
| arr = ['hello', 'world'] | |
| puts arr.object_id # 47264354160220 | |
| puts spin_me(arr).object_id # 47264354160220 |
| def spin_me(str) | |
| str.split.each do |word| | |
| word.reverse! | |
| end.join(" ") | |
| end | |
| str = 'hello world' | |
| puts str.object_id # 47435609148580 | |
| puts spin_me(str).object_id # 47435609148360 |
| def spin_me(str) | |
| str.split.each do |word| | |
| word.reverse! | |
| end.join(" ") | |
| end | |
| spin_me("hello world") |
| package controllers; | |
| import beans.Status; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; | |
| import java.util.ArrayList; |
| package controllers; | |
| import beans.Group; | |
| import java.io.IOException; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.ResultSet; | |
| import java.sql.SQLException; | |
| import java.sql.Statement; |
| package controllers; | |
| import beans.User; | |
| import beans.City; | |
| import controllers.CityController; | |
| import static db.DB.user; | |
| import java.io.IOException; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; |
| <?xml version='1.0' encoding='UTF-8' ?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" | |
| xmlns:h="http://java.sun.com/jsf/html" | |
| xmlns:f="http://java.sun.com/jsf/core" | |
| xmlns:b="http://bootsfaces.net/ui" | |
| xmlns:ui="http://java.sun.com/jsf/facelets" | |
| xmlns:p="http://primefaces.org/ui"> | |
| <h:head> | |
| <title>Ticket Service</title> |