You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 line
614 B

  1. describe("XSS: OAuth2 authorizationUrl sanitization", () => {
  2. it("should filter out a javascript URL", () => {
  3. cy.visit("/?url=/documents/security/xss-oauth2.yaml")
  4. .window()
  5. .then(win => {
  6. let args = null
  7. const stub = cy.stub(win, "open", (...callArgs) => {
  8. args = callArgs
  9. }).as("windowOpen")
  10. cy.get(".authorize")
  11. .click()
  12. .get(".modal-btn.authorize")
  13. .click()
  14. .wait(100)
  15. .then(() => {
  16. console.log(args)
  17. expect(args[0]).to.match(/^about:blank/)
  18. })
  19. })
  20. })
  21. })