Skip to content

add query string to changed uri in DispatchHandler - #8

Merged
vharseko merged 1 commit into
masterfrom
dispatch-handler
May 29, 2020
Merged

vharseko merged 1 commit into
masterfrom
dispatch-handler

Conversation

@maximthomas

Copy link
Copy Markdown
Contributor

No description provided.

@maximthomas
maximthomas requested a review from vharseko April 14, 2020 05:46
@vharseko
vharseko merged commit 5548fca into master May 29, 2020
@vharseko
vharseko deleted the dispatch-handler branch January 24, 2024 08:14
maximthomas added a commit to maximthomas/OpenIG that referenced this pull request Jul 2, 2024
vharseko added a commit that referenced this pull request Oct 22, 2026
Closes the two open `medium` Java code scanning alerts (#8, #9) and, on
the way, note #54.

| Alert | Rule | Location | Change |
|---|---|---|---|
| #8 | `java/local-temp-file-or-directory-information-disclosure` |
`Script.java` | The inline Groovy script cache directory was created
with `File.createTempFile()` → `delete()` → `mkdir()`: umask permissions
(typically `0755`, readable by other local users) plus a TOCTOU window
between delete and mkdir. The cached scripts are the `source` of route
configs, which may embed credentials. Now created with
`Files.createTempDirectory()` (atomic, `0700`); the script files with
`Files.createTempFile()` (`0600`); `FileWriter` in try-with-resources.
Also closes note #54 (`java/ignored-error-status-of-call` on the removed
`mkdir()`). |
| #9 | `java/log-injection` | `MQ_IBM.java`, `MQ_Kafka.java` | The
consumed message is written to the log as-is; a body containing line
breaks could forge log lines. Besides the flagged trace line, the body
also reaches the `INFO` log (the shipped root level) when the root
handler is not set yet — the consumers start with the heap, so messages
already queued at startup take that branch. `MQ_Kafka` has the same two
sinks; its trace line prints the consumed record with its `String` key.
All four now go through `MQLog.forLog()`, which replaces line breaks. |
| — | not flagged | `MQ_IBM.java` | The debug dump of the connection
factory settings printed every property, including `XMSC_PASSWORD`. The
password value is now masked (`MQ_IBM.settingForLog()`). |

Tests added:
- `ScriptTest`:
`shouldCreateInlineScriptCacheDirectoryReadableByOwnerOnly` and
`shouldCreateInlineScriptFileReadableByOwnerOnly` — both failed before
the fix with `GROUP_READ, GROUP_EXECUTE, OTHERS_READ, OTHERS_EXECUTE`
present. They tell the fix from umask-derived permissions only under a
group/other-readable umask such as the default `022`, and are skipped on
non-POSIX file systems (the Windows runners in the build matrix).
- `MQLogTest`: pins `MQLog.forLog()` and `MQ_IBM.settingForLog()` — with
either helper body reverted to returning its input, its test fails. The
handlers themselves are not exercised: `MQ_IBMTest` runs in the suite,
but without a live IBM MQ broker (see the `docker run` comment in it) it
only goes through the connection-failure paths and asserts nothing.

`MQ_IBM.java` and `MQ_Kafka.java` had no license header; both were
created in 2021 by 3A Systems, so a CDDL header with `Copyright
2021-2026 3A Systems, LLC.` is added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants