Crash Test - laboratoire local apres test actif XSS borne

Resultats cumules reels de l'analyse passive puis du test actif ZAP limite a la regle 40012 XSS reflechie, intensite Low, 1 thread, 2 minutes maximum. Cible uniquement 127.0.0.1:8080. Demonstration, pas audit exhaustif ni test municipal.

Site: http://127.0.0.1:8080

Generated on Wed, 28 Oct 2026 13:01:20

ZAP Version: 2.17.0

ZAP by Checkmarx

Summary of Alerts

Risk Level Number of Alerts
High
1
Medium
2
Low
3
Informational
1
False Positives:
0

Insights

Level Reason Site Description Statistic
Low
Warning
ZAP errors logged - see the zap.log file for details
2
Low
Warning
ZAP warnings logged - see the zap.log file for details
2
Info
Informational
http://127.0.0.1:8080
Percentage of responses with status code 2xx
100 %
Info
Informational
http://127.0.0.1:8080
Percentage of endpoints with content type text/html
75 %
Info
Informational
http://127.0.0.1:8080
Percentage of endpoints with content type text/plain
25 %
Info
Informational
http://127.0.0.1:8080
Percentage of endpoints with method GET
100 %
Info
Informational
http://127.0.0.1:8080
Count of total endpoints
4

Summary of Sequences

For each step: result (Pass/Fail) - risk (of highest alert(s) for the step, if any).

Alerts

Name Risk Level Number of Instances
Cross Site Scripting (Reflected) High 1
Content Security Policy (CSP) Header Not Set Medium 3
Missing Anti-clickjacking Header Medium 3
Cookie No HttpOnly Flag Low 3
Cookie without SameSite Attribute Low 3
X-Content-Type-Options Header Missing Low 4
Session Management Response Identified Informational 3

Alert Detail

High
Cross Site Scripting (Reflected)
Description
Cross-site Scripting (XSS) is an attack technique that involves echoing attacker-supplied code into a user's browser instance. A browser instance can be a standard web browser client, or a browser object embedded in a software product such as the browser within WinAmp, an RSS reader, or an email client. The code itself is usually written in HTML/JavaScript, but may also extend to VBScript, ActiveX, Java, Flash, or any other browser-supported technology.

When an attacker gets a user's browser to execute his/her code, the code will run within the security context (or zone) of the hosting web site. With this level of privilege, the code has the ability to read, modify and transmit any sensitive data accessible by the browser. A Cross-site Scripted user could have his/her account hijacked (cookie theft), their browser redirected to another location, or possibly shown fraudulent content delivered by the web site they are visiting. Cross-site Scripting attacks essentially compromise the trust relationship between a user and the web site. Applications utilizing browser object instances which load content from the file system may execute code under the local machine zone allowing for system compromise.

There are three types of Cross-site Scripting attacks: non-persistent, persistent and DOM-based.

Non-persistent attacks and DOM-based attacks require a user to either visit a specially crafted link laced with malicious code, or visit a malicious web page containing a web form, which when posted to the vulnerable site, will mount the attack. Using a malicious form will oftentimes take place when the vulnerable resource only accepts HTTP POST requests. In such a case, the form can be submitted automatically, without the victim's knowledge (e.g. by using JavaScript). Upon clicking on the malicious link or submitting the malicious form, the XSS payload will get echoed back and will get interpreted by the user's browser and execute. Another technique to send almost arbitrary requests (GET and POST) is by using an embedded client, such as Adobe Flash.

Persistent attacks occur when the malicious code is submitted to a web site where it's stored for a period of time. Examples of an attacker's favorite targets often include message board posts, web mail messages, and web chat software. The unsuspecting user is not required to interact with any additional site/link (e.g. an attacker site or a malicious link sent via email), just simply view the web page containing the code.
URL http://127.0.0.1:8080/search?q=%3C%2Fspan%3E%3CscrIpt%3Ealert%281%29%3B%3C%2FscRipt%3E%3Cspan%3E
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter q
Attack </span><scrIpt>alert(1);</scRipt><span>
Evidence </span><scrIpt>alert(1);</scRipt><span>
Other Info
Instances 1
Solution
Phase: Architecture and Design

Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.

Phases: Implementation; Architecture and Design

Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies.

For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters.

Consult the XSS Prevention Cheat Sheet for more details on the types of encoding and escaping that are needed.

Phase: Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.

Phase: Implementation

For every web page that is generated, use and specify a character encoding such as ISO-8859-1 or UTF-8. When an encoding is not specified, the web browser may choose a different encoding by guessing which encoding is actually being used by the web page. This can cause the web browser to treat certain sequences as special, opening up the client to subtle XSS attacks. See CWE-116 for more mitigations related to encoding/escaping.

To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XMLHTTPRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.

Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use an allow list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. Do not rely exclusively on looking for malicious or malformed inputs (i.e., do not rely on a deny list). However, deny lists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if you are expecting colors such as "red" or "blue."

Ensure that you perform input validation at well-defined interfaces within the application. This will help protect the application even if a component is reused or moved elsewhere.

Reference https://owasp.org/www-community/attacks/xss/
https://cwe.mitre.org/data/definitions/79.html
CWE Id 79
WASC Id 8
Plugin Id 40012
Medium
Content Security Policy (CSP) Header Not Set
Description
Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter
Attack
Evidence
Other Info
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter
Attack
Evidence
Other Info
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter
Attack
Evidence
Other Info
Instances 3
Solution
Ensure that your web server, application server, load balancer, etc. is configured to set the Content-Security-Policy header.
Reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP
https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html
https://www.w3.org/TR/CSP/
https://w3c.github.io/webappsec-csp/
https://web.dev/articles/csp
https://caniuse.com/#feat=contentsecuritypolicy
https://content-security-policy.com/
CWE Id 693
WASC Id 15
Plugin Id 10038
Medium
Missing Anti-clickjacking Header
Description
The response does not protect against 'ClickJacking' attacks. It should include either Content-Security-Policy with 'frame-ancestors' directive or X-Frame-Options.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter x-frame-options
Attack
Evidence
Other Info
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter x-frame-options
Attack
Evidence
Other Info
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter x-frame-options
Attack
Evidence
Other Info
Instances 3
Solution
Modern Web browsers support the Content-Security-Policy and X-Frame-Options HTTP headers. Ensure one of them is set on all web pages returned by your site/app.

If you expect the page to be framed only by pages on your server (e.g. it's part of a FRAMESET) then you'll want to use SAMEORIGIN, otherwise if you never expect the page to be framed, you should use DENY. Alternatively consider implementing Content Security Policy's "frame-ancestors" directive.
Reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
CWE Id 1021
WASC Id 15
Plugin Id 10020
Low
Cookie No HttpOnly Flag
Description
A cookie has been set without the HttpOnly flag, which means that the cookie can be accessed by JavaScript. If a malicious script can be run on this page then the cookie will be accessible and can be transmitted to another site. If this is a session cookie then session hijacking may be possible.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
Instances 3
Solution
Ensure that the HttpOnly flag is set for all cookies.
Reference https://owasp.org/www-community/HttpOnly
CWE Id 1004
WASC Id 13
Plugin Id 10010
Low
Cookie without SameSite Attribute
Description
A cookie has been set without the SameSite attribute, which means that the cookie can be sent as a result of a 'cross-site' request. The SameSite attribute is an effective counter measure to cross-site request forgery, cross-site script inclusion, and timing attacks.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter lab_demo
Attack
Evidence Set-Cookie: lab_demo
Other Info
Instances 3
Solution
Ensure that the SameSite attribute is set to either 'lax' or ideally 'strict' for all cookies.
Reference https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-same-site
CWE Id 1275
WASC Id 13
Plugin Id 10054
Low
X-Content-Type-Options Header Missing
Description
The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff'. This allows older versions of Internet Explorer and Chrome to perform MIME-sniffing on the response body, potentially causing the response body to be interpreted and displayed as a content type other than the declared content type. Current (early 2014) and legacy versions of Firefox will use the declared content type (if one is set), rather than performing MIME-sniffing.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter x-content-type-options
Attack
Evidence
Other Info This issue still applies to error type pages (401, 403, 500, etc.) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type. At "High" threshold this scan rule will not alert on client or server error responses.
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter x-content-type-options
Attack
Evidence
Other Info This issue still applies to error type pages (401, 403, 500, etc.) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type. At "High" threshold this scan rule will not alert on client or server error responses.
URL http://127.0.0.1:8080/robots.txt
Node Name http://127.0.0.1:8080/robots.txt
Method GET
Parameter x-content-type-options
Attack
Evidence
Other Info This issue still applies to error type pages (401, 403, 500, etc.) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type. At "High" threshold this scan rule will not alert on client or server error responses.
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter x-content-type-options
Attack
Evidence
Other Info This issue still applies to error type pages (401, 403, 500, etc.) as those pages are often still affected by injection issues, in which case there is still concern for browsers sniffing pages away from their actual content type. At "High" threshold this scan rule will not alert on client or server error responses.
Instances 4
Solution
Ensure that the application/web server sets the Content-Type header appropriately, and that it sets the X-Content-Type-Options header to 'nosniff' for all web pages.

If possible, ensure that the end user uses a standards-compliant and modern web browser that does not perform MIME-sniffing at all, or that can be directed by the web application/web server to not perform MIME-sniffing.
Reference https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/gg622941(v=vs.85)
https://owasp.org/www-community/Security_Headers
CWE Id 693
WASC Id 15
Plugin Id 10021
Informational
Session Management Response Identified
Description
The given response has been identified as containing a session management token. The 'Other Info' field contains a set of header tokens that can be used in the Header Based Session Management Method. If the request is in a context which has a Session Management Method set to "Auto-Detect" then this rule will change the session management to use the tokens identified.
URL http://127.0.0.1:8080/
Node Name http://127.0.0.1:8080/
Method GET
Parameter lab_demo
Attack
Evidence lab_demo
Other Info cookie:lab_demo
URL http://127.0.0.1:8080/about
Node Name http://127.0.0.1:8080/about
Method GET
Parameter lab_demo
Attack
Evidence lab_demo
Other Info cookie:lab_demo
URL http://127.0.0.1:8080/search?q=bonjour
Node Name http://127.0.0.1:8080/search (q)
Method GET
Parameter lab_demo
Attack
Evidence lab_demo
Other Info cookie:lab_demo
Instances 3
Solution
This is an informational alert rather than a vulnerability and so there is nothing to fix.
Reference https://www.zaproxy.org/docs/desktop/addons/authentication-helper/session-mgmt-id/
CWE Id
WASC Id
Plugin Id 10112

Sequence Details

With the associated active scan results.