Issues (982)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

styles/cops-monocle.js (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
/** global: Monocle */
2
Monocle.DEBUG = true;
3
4
(function () {
5
6
  /** global: Monocle */
7
  Monocle.Styles.container.right = "24px";
8
9
  // Initialize the reader element.
10
  /** global: Monocle */
11
  Monocle.Events.listen(
12
    window,
13
    'load',
14
    function () {
15
      var readerOptions = {};
16
17
      /* PLACE SAVER */
18
      var bkTitle = bookData.getMetaData('title');
0 ignored issues
show
The variable bookData seems to be never declared. If this is a global, consider adding a /** global: bookData */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
19
      var placeSaver = new Monocle.Controls.PlaceSaver(bkTitle);
20
      readerOptions.place = placeSaver.savedPlace();
21
      readerOptions.panels = Monocle.Panels.Marginal;
22
      readerOptions.stylesheet = "body { " +
23
        "color: #210;" +
24
        "font-family: Palatino, Georgia, serif;" +
25
      "}";
26
27
      /* Initialize the reader */
28
      window.reader = Monocle.Reader(
29
        'reader',
30
        bookData,
31
        readerOptions,
32
        function(reader) {
33
          reader.addControl(placeSaver, 'invisible');
34
35
          /* SPINNER */
36
          /** global: Monocle */
37
          var spinner = Monocle.Controls.Spinner(reader);
38
          reader.addControl(spinner, 'page', { hidden: true });
39
          spinner.listenForUsualDelays('reader');
40
41
          /* Because the 'reader' element changes size on window resize,
42
           * we should notify it of this event. */
43
          /** global: Monocle */
44
          Monocle.Events.listen(
45
            window,
46
            'resize',
47
            function () { window.reader.resized() }
48
          );
49
          
50
          /** global: Monocle */
51
          Monocle.Events.listen(window.top.document, 'keyup', function(evt) {
52
            var eventCharCode = evt.charCode || evt.keyCode;
53
            var dir = null;
54
            var flipper = reader.Flipper;
0 ignored issues
show
The variable flipper seems to be never used. Consider removing it.
Loading history...
55
            if (eventCharCode == 33 || eventCharCode == 37) { // Page down or Left arrow
56
              dir = -1;
57
            } else if (eventCharCode == 34 || eventCharCode == 39 ) { // Page down or Right arrow
58
              dir = 1;
59
            }
60
            if (dir) {
61
              reader.moveTo({ direction: dir });
62
              evt.preventDefault();
63
            }
64
          });
65
66
          /* MAGNIFIER CONTROL */
67
          /** global: Monocle */
68
          var magnifier = new Monocle.Controls.Magnifier(reader);
69
          reader.addControl(magnifier, 'page');
70
71
          /* BOOK TITLE RUNNING HEAD */
72
          var bookTitle = {}
73
          /** global: Monocle */
74
          bookTitle.contentsMenu = Monocle.Controls.Contents(reader);
75
          reader.addControl(bookTitle.contentsMenu, 'popover', { hidden: true });
76
          bookTitle.createControlElements = function () {
77
            var cntr = document.createElement('div');
78
            cntr.className = "bookTitle";
79
            var runner = document.createElement('div');
80
            runner.className = "runner";
81
            runner.innerHTML = reader.getBook().getMetaData('title');
82
            cntr.appendChild(runner);
83
84
            /** global: Monocle */
85
            Monocle.Events.listenForContact(
86
              cntr,
87
              {
88
                start: function (evt) {
89
                  if (evt.preventDefault) {
90
                    evt.stopPropagation();
91
                    evt.preventDefault();
92
                  } else {
93
                    evt.returnValue = false;
94
                  }
95
                  reader.showControl(bookTitle.contentsMenu);
96
                }
97
              }
98
            );
99
100
            return cntr;
101
          }
102
          reader.addControl(bookTitle, 'page');
103
104
105
          /* CHAPTER TITLE RUNNING HEAD */
106
          var chapterTitle = {
107
            runners: [],
108
            createControlElements: function (page) {
109
              var cntr = document.createElement('div');
110
              cntr.className = "chapterTitle";
111
              var runner = document.createElement('div');
112
              runner.className = "runner";
113
              cntr.appendChild(runner);
114
              this.runners.push(runner);
115
              this.update(page);
116
              return cntr;
117
            },
118
            update: function (page) {
119
              var place = reader.getPlace(page);
120
              if (place) {
121
                this.runners[page.m.pageIndex].innerHTML = place.chapterTitle();
122
              }
123
            }
124
          }
125
          reader.addControl(chapterTitle, 'page');
126
          reader.listen(
127
            'monocle:pagechange',
128
            function (evt) { chapterTitle.update(evt.m.page); }
129
          );
130
131
132
          /* PAGE NUMBER RUNNING HEAD */
133
          var pageNumber = {
134
            runners: [],
135
            createControlElements: function (page) {
136
              var cntr = document.createElement('div');
137
              cntr.className = "pageNumber";
138
              var runner = document.createElement('div');
139
              runner.className = "runner";
140
              cntr.appendChild(runner);
141
              this.runners.push(runner);
142
              this.update(page, page.m.place.pageNumber());
143
              return cntr;
144
            },
145
            update: function (page, pageNumber) {
146
              if (pageNumber) {
147
                this.runners[page.m.pageIndex].innerHTML = pageNumber;
148
              }
149
            }
150
          }
151
          reader.addControl(pageNumber, 'page');
152
          reader.listen(
153
            'monocle:pagechange',
154
            function (evt) {
155
              pageNumber.update(evt.m.page, evt.m.pageNumber);
156
            }
157
          );
158
159
          /* Scrubber */
160
          /** global: Monocle */
161
          var scrubber = new Monocle.Controls.Scrubber(reader);
162
          reader.addControl(scrubber, 'popover', { hidden: true });
163
          var showFn = function (evt) {
164
            evt.stopPropagation();
165
            reader.showControl(scrubber);
166
            scrubber.updateNeedles();
167
          }
168
          for (var i = 0; i < chapterTitle.runners.length; ++i) {
169
            /** global: Monocle */
170
            Monocle.Events.listenForContact(
171
              chapterTitle.runners[i].parentNode,
172
              { start: showFn }
173
            );
174
            /** global: Monocle */
175
            Monocle.Events.listenForContact(
176
              pageNumber.runners[i].parentNode,
177
              { start: showFn }
178
            );
179
          }
180
        }
181
      );
182
    }
183
  );
184
})();
185