Skip to content

Commit acf4927

Browse files
committed
Log Forging for Java and Python
1 parent 08954cb commit acf4927

File tree

23 files changed

+864
-7
lines changed

23 files changed

+864
-7
lines changed

Log Forging/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Log Forging
2+
3+
__Log Forging__ is a security vulnerability that occurs when unvalidated user input is written to the log files, allowing attackers to manipulate log entries or inject malicious content. Attackers can create misleading log entries, compromising the integrity of the logs and pushing the SOC team or the blue team into a rabit hole while creating false log entries. Common methods of log injection include __CRLF Injection__ It is also known as __Log Injection__
4+
5+
You can use this repo as reference to mitigate the Log Forging/Log Injection vulnerability [CWE-117](https://cwe.mitre.org/data/definitions/117.html).
6+
7+
## :warning: Important NOTE
8+
9+
Never hardcode sensitive information in the logs(like passwords, tokens, user details, PII, PFI, PHI, etc.) it can result into other vulnerabilities, Privacy Violation [CWE-359](https://cwe.mitre.org/data/definitions/359.html), Trust Boundary Violation [CWE-501](https://cwe.mitre.org/data/definitions/501.html), Sensitive information exposure in the logs[CWE-532](https://cwe.mitre.org/data/definitions/532.html).
10+
11+
## Mitigation
12+
13+
:lock: Best Practices for Secure Coding in the Logs.
14+
15+
:one: Input Sanitization to escape the CRLF characters and other dangerous characters.
16+
17+
:two: Use Parameterized Logging
18+
19+
:three: Restrict Log File Access
20+
21+
:four: Centralized Logging and Monitoring
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

Log Forging/java/mvnw

Lines changed: 259 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)